필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Help with FFT Analysis

조회 수: 2 (최근 30일)
Vince Roman
Vince Roman 2015년 2월 24일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi,
How could I use the fft analysis on this signal:
I am trying to find which filter would be the most ideal to get as close to the original signal as I can.
% Signal Generation
xLim = 1000; % Generate numbers from 0 to 1000.
dx = 0.01; % Increment of 0.01.
x = 0:dx:xLim-1; % Generate a series of numbers from 0 to 999 (xLim-1) with increment of 0.01.
y0 = 6*sin(0.4*pi*x); % Create sine signal.
y = awgn(y0,0.01,'measured'); % Addition of noise
% Filtering of Noise using Savitzky-Golay
N = 2;
% Filter 1 F = 11; % Window length 11,23,35,47,59
[b,g] = sgolay(N,F); % Calculate S-G coefficients
HalfWin = ((F+1)/2) -1;
for n = (F+1)/2:(length(x)-5)-(F+1)/2,
% Zeroth derivative (smoothing only)
SG1(n) = dot(g(:,1),y(n - HalfWin:n + HalfWin));
end
% Filter 2 F = 23; % Window length 11,23,35,47,59
[b,g] = sgolay(N,F); % Calculate S-G coefficients
HalfWin = ((F+1)/2) -1;
for n = (F+1)/2:(length(x)-5)-(F+1)/2,
% Zeroth derivative (smoothing only)
SG2(n) = dot(g(:,1),y(n - HalfWin:n + HalfWin));
end
At the moment I tried to use: A1=fft(SG1); A2=fft(SG2);
Not really sure how to apply the fft coding and if I am doing it correctly, I was told I can also use snr after between the filtered data and the fft data after carrying out the FFT analysis of the noisy signal
Thanks

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by