FIR filtering & FFT processing for a signal

Hi, I have the question below:
Part 1: 1) I do not know what to design the filters to be, based on what? 2) I am not sure if I displayed the magnitude spectrum correctly. 3) how do i process the signal by the filter?
Part 2: How do I filter by using FFT processing?
please find my code is in the M-FILE attached . Your help is appreciated.

 Accepted Answer

It looks like they don't care what filter you use. Why not just use a rect filter (a box)? You can do this with just convolving with ones.
firFilter = ones(1, 21)/21; % Or whatever window width you want.
out = conv(in, firFilter, 'same');
Take the FFT of both original and filtered signals and display them. Use subplot(2,2,n) to display the 4 signals all in one figure.

5 Comments

Part 2 is totally incomprehensible. The only thing I can guess is that they want you do zero out certain ranges of the spectrum and inverse transform to see how that Fourier filtering looks back in the time domain. But it's very poorly worded. They're probably trying to get you to demonstrate how you can get the same effect (same output signal) no matter if you convolve in the time domain or multiply in the Fourier domain, but their problem statement is not very precisely worded or described.
Part 1 -
a) they want two FIR filters, one is second order, the other is fourth order, i'm not sure how to do that
b) i am not sure if my magnitude specturm is right the way I did it for the synthesized signal
Part 2 - They want us to do the FFT for the whole input signal without segmentation because in the later parts they ask us to do overlap-add and overlap-save etc
so now in part 2 what do they want me to do? I'm not really sure
I don't know what a fourth order and second order filter mean. I usually deal with images. Is it like different models of Butterworth filters? Perhaps - did you talk about that in class? Sorry, but I'm not such an expert on 1D signal analysis.
I don't know what segmentation means in that context. The only way I've heard segmentation used in an imaging context is to divide an image into foreground and background objects (or blobs you want and blobs you don't want). But that doesn't really seem to be a good definition when you're talking about filtering in the Fourier domain.
can you please check if this is correct:
% Determine the first 50 samples of this signal
signal_first_50_samples= signal (1:50);
% Display its magnitude spectrum.
N = 2048;
signal_spect = abs (fft(signal_first_50_samples,N));
signal_spect = fftshift(signal_spect);
F = [-N/2:N/2-1]/N;
plot (F, signal_spect)
set(gca, 'XTick',[-0.5:0.1:1])
grid on;

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!