Why Do digitalFilter Object Functions Ignore the Filter's SampleRate Property?
47 ビュー (過去 30 日間)
古いコメントを表示
Design a low pass filter
lpFilt = designfilt('lowpassiir','FilterOrder',8, ...
'PassbandFrequency',35e3,'PassbandRipple',0.2, ...
'SampleRate',200e3);
Plot its frequency response using the digitalFilter object function freqz
figure
freqz(lpFilt,4096)
I'm surprised that the default behavior is to plot against normalized frequency, rather than using the SampleRate parameter of the object to plot against ordinary frequency.
lpFilt.SampleRate
Maybe the idea is to be consistent with how the function freqz() behaves for inputs that are not digitalFilter objects. But then I'm really surprised that the object function allows the user to specify a different sample rate than that for which the filter is designed
figure
freqz(lpFilt,4096,lpFilt.SampleRate*3);
Similarly the object function impz allows one to specify a different sample rate
figure
impz(lpFilt,100,lpFilt.SampleRate/2)
Any idea why the object functions of a digitalFilter seem to completely ignore its SampleRate property?
0 件のコメント
回答 (1 件)
Ashok
2024 年 12 月 31 日 5:16
Hi John,
The ability to specify sample rates in the freqz or impz functions, can be useful for visualizing how the response would appear if the filter were designed for another sample rate and same normalized frequency. Further, this approach ensures that user is aware of the sample rate context when interpreting the frequency response.
As an alternative, fvtool can be used for filter visualization. It provides plots of frequency, step, impulse response, and more, while considering the sample rate specified during filter design. Here's an example:
Fs = 1000; % Sample rate in Hz
Fc = 100; % Cutoff frequency in Hz
dFilt = designfilt('lowpassiir','FilterOrder',4,'HalfPowerFrequency',Fc,'SampleRate',Fs,'DesignMethod','butter');
fvtool(dFilt)
For more information kindly refer the following documentation page:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Digital Filter Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!