Matlab mixed IIR Filter
Afficher commentaires plus anciens
I need help to design the next IIR filter:
The input signal is composed of 1Hz and 30Hz sine waves. The signal sampling frequency is 100Hz and a total of 480 points are sampled. Signals below 7Hz are removed by the IIR.
There are 480 samples. Sample 0~159 are 30Hz sine waves, sample 160~319 are 1Hz sine waves and sample 320~479 are 30Hz sine waves.
I tried to do, but it looks not correct.
fs=100 % sampling frequency
f1=1
f2=30 % frequency of the signal
t=20 % time duration
n=[0:1/fs:t] % sample period
x1=sin(2*pi*f1*n) % single tone signal
subplot(3,1,1)
plot(n,x1)
x2=0.5*sin(2*pi*f2*n)
grid on
title('Sinusoidal signal');
% lssnew = merge(lss1,...,lssN)
z = [x1;x2]; % merge 2 signals
subplot(3,1,2)
plot(n,z)
Could someone give me an example how I can do it?
Thank you in advance.
2 commentaires
Askic V
le 6 Déc 2022
This is very unusual description of a problem. I assume you have samples in an array, so if you know for sure which samples are from sine waves 7 Hz or below (in this case 1 Hz), you just remove them from the array
samples_arr(161:320) = []
In Matlab, indexing starts with 1 and not 0 like in most other programing languages.
But if you need to design IIR filter, then I suggest you to check the following thread:
https://www.mathworks.com/matlabcentral/answers/284804-how-to-design-iir-highpass-filter-with-cutoff-frequency-of-20hz-and-fir-bandpass-filter-with-cutoff
AndyK
le 6 Déc 2022
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Filter Design dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
