J'effectue FFT-IFFT afin de retirer 50 Hz et ses harmoniques de mon signal, en utilisant Matlab. Pour ce faire, je divise mon signal en fenêtres de 1024 échantillons et j'effectue une FFT. Je fais également un chevauchement de 50%. Une fois la FFT terminée, je retire ces harmoniques et je fais IFFT pour obtenir des données filtrées. Ma question est: Comment résumer toutes ces fenêtres avec des chevauchements pour obtenir un signal?FFT-IFFT. Comment résumer le signal final après IFFT?
mon code est ci-dessous. Comme vous pouvez le voir, j'effectue FFT-IFFT sur chaque fenêtre et je ne sais pas comment reconstituer toutes les fenêtres.
[y, Fs, nbits] = wavread([fileName]); %read the data
[noSamples, noChannels] = size(y);
N = 1024; %window length 2^10
winLength=N;
Fres = Fs/N; % resolution frequency
nofWins = floor(noSamples/winLength); % No of full windows
noWins = round((100/50)*nofWins - 1); % rounded no of windows
yPaddedLength = floor(noWins*0.5*winLength + winLength); % padding wth 0
yZeroPadded =[y zeros(1, (yPaddedLength - noSamples))]; % padded signal y
nofWinsPadded = round(yPaddedLength/winLength);
noWinsPadded = round((100/50)*nofWinsPadded - 1); % no of padded windows
odd = true;
for k = 1:(noWinsPadded-1)
j = floor(0.5*k);
at = j*winLength + 1;
overlapWinLength=floor(0.5*winLength);
range = at:(at + winLength - 1);
if odd
data = yZeroPadded(range, 1);
data_sum=sum(data); % from now on - to perform
% DC removal
data_average=data_sum/N;
data=data-data_average;
else
data = yZeroPadded(range+overlapWinLength, 1);
data_sum=sum(data);
data_average=data_sum/N;
data=data-data_average;
end;
odd=~odd;
spectrum = fft(data);
F=length(spectrum);
F=spectrum;
F(10:11)=zeros; % FFT No equals to zero removes harmonics
F(17:18)=zeros % and so on
filtered_signal=IFFT(F);
vous remerciant par avance, Elen Che
ok, je m'attendais à ce que ... Dois-je supprimer DC? –
@ElenChe: C'est à vous de;) –