FIR filtering & FFT processing for a signal

조회 수: 8 (최근 30일)
MatlabGirl
MatlabGirl 2014년 12월 6일
댓글: MatlabGirl 2014년 12월 7일
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.

채택된 답변

Image Analyst
Image Analyst 2014년 12월 6일
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
MatlabGirl
MatlabGirl 2014년 12월 7일
MatlabGirl
MatlabGirl 2014년 12월 7일
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;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Frequency Transformations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by