![FIltering for multiple band of frequncies - 2020 02 06.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/270281/FIltering%20for%20multiple%20band%20of%20frequncies%20-%202020%2002%2006.png)
FIltering for multiple band of frequncies
126 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ramya Raman
le 6 Fév 2020
Commenté : Star Strider
le 24 Oct 2022
I have below two questions.
- I want to filter a signal with sampling 100Hz in range of 4-7Hz and 10-13Hz and 30-35Hz. I saw the bandpass function that says to filter seperating and concatenate the filtered signal. But I want to know if we could filter these 3 range of frequncies with any specific filter?
- What is bandpass or bandstop ripple and how to we choose the ripple ?
0 commentaires
Réponse acceptée
Star Strider
le 6 Fév 2020
As much as I like elliptic filters, creating three of them and filtering them in parallel is simply not efficient. Multiband filters are much easier to implement as FIR filters.
Try a FIR filter such as this one:
Fs = 100; % Sampling Frequency (Hz)
fcuts = [3.5 4 7 7.5 9.5 10 13 13.5 29 30 35 36]; % Frequencies
mags = [0 1 0 1 0 1 0 ]; % Passbands & Stopbands
devs = [0.05 0.01 0.05 0.01 0.05 0.01 0.05]; % Tolerances
[n,Wn,beta,ftype] = kaiserord(fcuts,mags,devs,Fs); % Kaiser Window FIR Specification
n = n + rem(n,2);
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale'); % Filter Realisation
figure
freqz(hh,1,2^14,Fs)
set(subplot(2,1,1), 'XLim',[0 50]); % Zoom Frequency Axis
set(subplot(2,1,2), 'XLim',[0 50]); % Zoom Frequency Axis
Then use the filtfilt function to do the actual filtering:
signal_filtered = filtfilt(hh, 1, signal);
The Bode plot for this filter:
![FIltering for multiple band of frequncies - 2020 02 06.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/270281/FIltering%20for%20multiple%20band%20of%20frequncies%20-%202020%2002%2006.png)
10 commentaires
Ameen
le 24 Oct 2022
So the stopbands are [55 59], [61,64], [61 64]+60, [61 64]+120 and passbands are [59,61], [55 59]+60, [55 59]+120 in the first example?
Star Strider
le 24 Oct 2022
No, they’re [59 61], [119 121], and [179 181] (or [59 61], [59 61]+60 and [59 61]+120) in this illustration.
They’re the centre two frequencies in those vectors.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Digital and Analog Filters 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!