Why Do digitalFilter Object Functions Ignore the Filter's SampleRate Property?
46 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Ashok
el 31 de Dic. de 2024 a las 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 comentarios
Ver también
Categorías
Más información sobre Digital Filter Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!