fft application for signal processing to know frequency

6 views (last 30 days)
I have some signal data as shown below. It is constructed with 624 sample points from text file. This signal generated from a 4MHz ultrasonic transducer. By applying FFT in Matlab, I want to know which frequency is dominating in the below signal.
For the above purpose I am able to read the data from text file and plot it as shown above. After that iam applying FFT by using abs(fft(‘textfile name’ , N)) Please suggest me where to define the frequency of signal in the code and what should be the N value in fft command line. With out giving N value and frequency parameters iam getting the following figure
How the X-axis values to be converted to frequency values, because the x-axis is showing only 624 values. Whether the above plot is correct or not. Please guide me

Answers (1)

Star Strider
Star Strider on 24 Nov 2014
See the documentation for fft, specifically the section after the first figure that demonstrates how to calculate the frequency vector for your plot:
NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
You need your sampling frequency (here ‘Fs’) to calculate the ‘f’ (frequency) vector.
  4 Comments
Ramesh
Ramesh on 12 Dec 2014
Dear Strider,
The thickness of my testing object is 25mm and the range of x-axis selected is 250 mm. so thats why i will be getting 10 echos, each located at 25mm on x-axis. with the above data available what is 'Fs' value? what is 'L' value?
Star Strider
Star Strider on 12 Dec 2014
You say your data are generated by a ‘4MHz ultrasonic transducer’. I assume the carrier frequency is 4MHz. You have to look through the documentation for your transducer and probably the file itself to find out what the sampling frequency ‘Fs’ is. I cannot tell it from your data.
If you have a time vector for your 624 data points, what is the difference (in seconds) between the consecutive sampling points? That is your sampling interval or sampling time ‘Ts’, and you can calculate the rest from the code I posted in my [24 Nov 2014, 18:42] Comment.
‘L’ is the length of your data vector, so here:
L = 624;

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!