Convert Voltage vs. Time data to frequency domain

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

回答 (3 件)

Star Strider
Star Strider 2016 年 2 月 8 日

0 投票

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 件のコメント

rogan king
rogan king 2016 年 2 月 9 日
Thank you. The bandwidth is not a external hardware filter. It is set like that in the oscilloscope.
So then how do I model my signal's equation to use fft?The equation would be some combination of y = 2 sin(2*pi*f*t). My problem is that there are different combination of sinusoids in the signal. Whats the best way to model it? Any help.
Star Strider
Star Strider 2016 年 2 月 9 日
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
Star Strider 2016 年 2 月 9 日
‘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
Walter Roberson 2016 年 2 月 8 日

0 投票

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.
rogan king
rogan king 2016 年 2 月 9 日

0 投票

I think I got this now. Here is what I did: I fft my voltage values using fft function and then I was worried about what my x-axis would be. So I looked into the data and counted how many data I had for 1 second. This became my maximum value for frequency. Then my frequency looked like this fx = linspace(0,25,10660) where 10660 was the size returned by fft. It worked out for me. Let me know if you find any concerns. Thanks for all of yours help.

質問済み:

2016 年 2 月 8 日

コメント済み:

2016 年 2 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by