Home > Back-end >  After FFT transform cannot use matlab ifft to restore the original signal
After FFT transform cannot use matlab ifft to restore the original signal

Time:09-28

FFT transform of the original signal, obtains is unilateral Fourier transform, and its amplitude processing, in which a piece of code below, need to go back to the time domain, after processing code directly in the IFFT transformation, refer to the online mode of a code, although waveform on a bit, but still not right, waveform, this figure is the original signal with a window, figure 2 is the IFFT waveform, I am a novice, matlab thinking if I need before IFFT to signal processing, or after IFFT transformation, the signal has a problem, the abscissa wrote their access to a lot of data, no find the right solutions, so want to ask next everybody can tell,
The code is as follows:
close all;
clear all;
clc;

Ts=50 e - 6;
Fs=1/Ts;
F0=50;
DuraT=1;

Dt=1/Fs.
TAxis=dt, dt (duraT - dt);

Y=2 * sin (2 * PI * 10 * tAxis);
Y=y ';

L=length (y);
NFFT=2 ^ nextpow2 (L);
Y_HannWind=y. * hann (L);
Ydft_HannWnd=FFT (y_HannWind, NFFT)/L;

MYdft=abs (Ydft_HannWnd);
MYdft=mYdft (1: NFFT/2 + 1);
MYdft (2: end - 1)=2 * mYdft (2: end - 1);
MYdft=2 * mYdft;

F=Fs/2 * linspace (0, 1, NFFT/2 + 1);

Temp=ifft (mYdft, "symmetric");


Figure (1)
Subplot (211)
The plot (tAxis, y_HannWind)
The title (' Time Domain y (t));
Xlabel (' Time, s');
Ylabel (' y ');
Subplot (212)
The plot (f, mYdft);
The axis ([0 500, 0 5));
The title (' Amplitude Spectrum with Hann Wnd ');
Xlabel (' Frequency (Hz) with hanning window ");
Ylabel (' Y (f) | | ')

Figure (2)
T=the Fs * linspace (0, 1, NFFT/2 + 1);
The plot (t, abs (temp))

  • Related