Clear Filters
Clear Filters

Help with removing the transient part in FFT

8 views (last 30 days)
I want to remove the transient psrt from my fft of TE to clearly see the frequency components. I have tried removing the transient part say first 0.05 sec, but it doesn't work
My code is here: https://uk.mathworks.com/matlabcentral/answers/1937134-help-with-computing-fft?s_tid=prof_contriblnk

Answers (1)

Bhanu Prakash
Bhanu Prakash on 12 May 2023
Hi Siddharth,
As per my understanding, you want to remove the transient part in FFT.
To remove the transient part of FFT, you must apply a window function to the input signal before computing the FFT. Consider the code shown below:
N=128;
window_start=1;
window_stop=20;
x=rand(N,1);
x(window_start:window_stop)=x(window_start:window_stop).*hann(window_stop-window_start+1);
X=fft(x);
plot(abs(X));
where, "N" is the FFT size and "x" is a 128x1 matrix containing random values ranging in the range (0,1). To remove transient in a particular interval, "window_start" & "window_stop" are used.
The window function "hann" is applied to the values of "x" in the interval (window_start, window_stop), to remove the transient in that interval. Then the FFT is computed with the help of "fft" function.
For more information on the above-mentioned functions, you can refer to the following documentation:
For "rand" function:
For "hann" function:
For "fft" function:

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!