Filter design parameter: radian/sec or 1/sec?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tsung-Ju Yang
le 4 Juin 2017
Réponse apportée : Star Strider
le 4 Juin 2017
Dear All, I am confused with some fundamental problem in Matlab. Sorry to as such a basic problem.
Signal: x[n]= cos(2*pi*(n-1)*Ts)+2*cos(2pi*f*(n-1)*Ts), n=1,2,3,...,1000 and Ts=0.002
I want to design filter to get the first term and the second term respestively with 16-order filter. But I am not sure the passband should be
"1Hz, f Hz" or "2pi, 2pi*f"
when I call the filter function such as butter, cheby1, cheby2, ellip in IIR or in FIR. May you so kind give me an example?
0 commentaires
Réponse acceptée
Star Strider
le 4 Juin 2017
The passbands and stopbands for the Signal Processing Toolbox filter functions are actually normalised to the closed interval [0, pi] radians. It is calculated as the passband and stopband frequency in Hz divided by the Nyquist frequency.
Example for frequency calculations for the filters your signal:
Ts = 0.002; % Sampling Interval (seconds)
Fs = 1/Ts; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency
Note that the highest frequency you can design in your filter is the Nyquist frequency, here 250 Hz.
An example of a Chebyshev Type II filter design for filtering an EKG signal is here:
Fs = 250; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = [1.0 100]/Fn; % Passband Frequencies (Normalised)
Ws = [0.5 101]/Fn; % Stopband Frequencies (Normalised)
Rp = 10; % Passband Ripple (dB)
Rs = 50; % Stopband Ripple (dB)
[n,Ws] = cheb2ord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = cheby2(n,Rs,Ws); % Filter Design
[sosbp,gbp] = zp2sos(z,p,k); % Convert To Second-Order-Section For Stability
figure(3)
freqz(sosbp, 2^17, Fs)
EKG_filt = filtfilt(sosbp, gbp, EKG_original); % Filter EKG Signal
The filter passband goes from 1 Hz to 100 Hz.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Filter Design dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!