Convert Voltage vs. Time data to frequency domain
20 views (last 30 days)
Show older comments
Hi I have a voltage vs. time data as shown in the graph below. I need to convert this data into frequency domain. I did look up fft but I cant accurately define my sampling frequency, frequency of the signal itself, and the signal's equation. I took this data from oscilloscope set at 50k samples/sec and Bandwidth 500 MHz. Please let me know. Thanks

0 Comments
Answers (3)
Star Strider
on 8 Feb 2016
You can verify that the sampling frequency of your signal if 50 kHz by doing a few statistics on it:
Time - ...; % Time Vector
Tsm = mean(diff(Time)); % Mean Sampling Frequency (Seconds)
Tss = std(diff(Time)); % Standard Deviation Of Time Differences
Tsc = Tss/Tsm; % Coefficient of Variation
If ‘Tsc’ is on the order of 1E-3 or less, you can reasonably assume a constant sampling interval.
Your sampling frequency is then:
Fx = 1/Tsm; % Sampling Frequency (Hz);
The R2015a fast Fourier Transform documentation, fft, is likely the most helpful, especially the code between the top two plot images.
A bandwidth of 500 MHz is inappropriate for a sampling frequency of 50 kHz, since your highest resolvable frequency (the Nyquist frequency) is 25 kHz. Your bandwidth (that I assume is a hardware filter) should be set equal to the Nyquist frequency to avoid aliasing.
3 Comments
Star Strider
on 9 Feb 2016
The fft is going to give you the necessary information to plot each sinusoid as a separate frequency, amplitude, and phase.
For each frequency, you model would be:
y = A * sin(2*pi*f*t + phi)
where ‘phi’ is the phase (in radians), and ‘A’ is the amplitude. If you get your data from a one-sided fft, you would multiply each amplitude by 2:
y = 2 * A * sin(2*pi*f*t + phi)
To model your signal, you would then sum these terms in a loop. It would be your choice as to how many sinusiods to use. You would also have to add in the amplitude of the d-c component (the first value of the fft) to your summed sinusoids.
Star Strider
on 9 Feb 2016
‘Let me know if you find any concerns.’
I do have concerns. You did not show the code you used to calculate and plot your transformed data.
I would feel better if I knew what you did, since this seems to be your research and I want to do what I can to be certain you’re calculating your data correctly. See the R2015a documentation for fft for a description on how to code it. Particularly note the code between the top two plot figures.
Walter Roberson
on 8 Feb 2016
If your signal turns out to not be uniformly spaced in time to beyond the margin of error you are willing to live with, then you should use a non-uniform fft.
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!