I enabled fft function in oscillioscope and it saved the data as FF... (2024)

34 次查看(过去 30 天)

显示 更早的评论

Honey 2024-7-14,11:45

  • 链接

    此问题的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d

  • 链接

    此问题的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d

评论: Star Strider 2024-7-16,16:14

采纳的回答: Star Strider

  • 550mvp.csv

%%

folder = 'C:\Users\haneu\OneDrive\바탕 화면\New folder (2)';

filename = '550mvp.csv';

data = readtable(fullfile(folder,filename));

frequency = table2array(data(3:end,1));

amplitude = table2array(data(3:end,2));

figure,plot(frequency/1e6,amplitude)

xlim([0,15])

xlabel('Frequency [MHz]'),

grid on,

ylabel('Amplitude[dBV]')

0 个评论

显示 -2更早的评论隐藏 -2更早的评论

请先登录,再进行评论。

请先登录,再回答此问题。

采纳的回答

Star Strider 2024-7-14,12:35

  • 链接

    此回答的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#answer_1485118

  • 链接

    此回答的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#answer_1485118

编辑:Star Strider 2024-7-14,13:24

  • 550mvp.csv

You cannot reliably invert a Fourier transforom unless you also have the phase information. Lacking the phase information, you can still invert it, however the result will not be reliable and may not reflect the actual time-domain signal. The best approach is to record the time-domain signal and calculate the Fourier transform afterwards.

One approach —

RL = readlines('550mvp.csv');

H1 = split(RL(1,:),',');

H2 = split(RL(2,:),',');

T1 = readtable('550mvp.csv', 'HeaderLines',2);

T1.Properties.VariableNames = H1.'

T1 = 4002x2 table

x-axis 1 ___________ __________ -2.46e-05 0.025633 -2.4575e-05 0.019603 -2.455e-05 0.0099925 -2.4525e-05 0.0015126 -2.45e-05 -0.0065276 -2.4475e-05 -0.014568 -2.445e-05 -0.023048 -2.4425e-05 -0.030648 -2.44e-05 -0.036678 -2.4375e-05 -0.042709 -2.435e-05 -0.044719 -2.4325e-05 -0.048739 -2.43e-05 -0.052759 -2.4275e-05 -0.052759 -2.425e-05 -0.056339 -2.4225e-05 -0.052759

NrMissing = nnz(ismissing(T1))

NrMissing = 4

T1 = fillmissing(T1, 'linear');

figure

plot(T1{:,1}, T1{:,2})

grid

xlabel(H2(1,:))

ylabel(H2(2,:))

I enabled fft function in oscillioscope and it saved the data as FF... (3)

L = height(T1)

L = 4002

Fn = max(T1{:,1}); % Nyquist Frequency

Fs = Fn*2; % Sampling Frequency

Ts = 1/Fs; % Sampling Interval

Lt = 2*L; % Assumed Length Of Original Time-Domain Signal

t = linspace(0, Lt-1, Lt)/Fs; % Time Vector

v = ifft([T1{:,2}; flip(T1{:,2})],'symmetric');

v = 8004x1

figure

plot(t, v)

grid

xlabel('Time')

ylabel('Volt')

xlim([min(t) max(t)])

I enabled fft function in oscillioscope and it saved the data as FF... (4)

figure

plot(t, v)

grid

xlabel('Time')

ylabel('Volt')

xlim([min(t) 1E-6])

I enabled fft function in oscillioscope and it saved the data as FF... (5)

This initially re-creates the full ‘original’ two-sided Fourier ttransform by appending a flipped version of the original one-sided Fourier transform to it and then doing the inversion. The highest frequency is assumed to be the Nyquist frequency here, and the sampling frequency and sampling intervals are calculatted from it.

.

EDIT — Corrected typographical errors.

EDIT — (14 Jul 2024 at 13:24)

Forgot the symmetry flag in the ifft call. Added now.

.

10 个评论

显示 8更早的评论隐藏 8更早的评论

John D'Errico 2024-7-14,13:01

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210908

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210908

Always a pleasure to read a good answer.

Honey 2024-7-14,13:14

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210913

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210913

I see the amplitude I gave was in mili Volt peak to peak.Is there a posibility to plot a spectrogram with current data I have.I see time domain signals are not exactly the same you are right the pase information is lacking.

Honey 2024-7-14,13:14

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210918

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210918

I appreciate your help. :)

Star Strider 2024-7-14,13:31

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210923

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210923

@John D'Errico — I very much appreciate your compliment!

@Honey — As always, my pleasure!

To plot the spectrogram, use the reconstructed time-dopmain signal, or preferably tthe original time-domain signal if you have it. I generally prefer the pspectrum function witth the 'spectrogram' option because it calculates the power spectrum spectrogram (units are dB), not the power density spectrogram (units are dB/Hz).

Honey 2024-7-14,13:40

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210928

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210928

hey thanks for your help I got the time domain data save its saved seperately in Csv file for fft and time domain.sorry for the trouble:p

Star Strider 2024-7-14,14:14

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210938

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3210938

@Honey — No trouble at all!

Here’s my one-sided Fourier transform function, in the event you want to use it —

function [FTs1,Fv] = FFT1(s,t)

% Arguments:

% s: Signal Vector

% t: Associated Time Vector

t = t(:);

L = numel(t);

if size(s,2) == L

s = s.';

end

Fs = 1/mean(diff(t));

Fn = Fs/2;

NFFT = 2^nextpow2(L);

FTs = fft((s - mean(s)) .* hann(L).*ones(1,size(s,2)), NFFT)/sum(hann(L));

Fv = Fs*(0:(NFFT/2))/NFFT;

% Fv = linspace(0, 1, NFFT/2+1)*Fn;

Iv = 1:numel(Fv);

FTs1 = FTs(Iv,:);

end

I wrote it because I was simply tired of typing the same code every time I wanted to use the fft function.

.

Honey 2024-7-15,3:10

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3211243

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3211243

once again Thanks alot.

Star Strider 2024-7-15,10:57

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3211453

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3211453

As always, my pleasure!

Honey 2024-7-16,15:30

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3212718

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3212718

  • 270mvp3.csv
  • 550mvp.csv

@Star Strider Hi I have a question related to pspectrum.I have csv file related to different voltage data.I used p spectrum function to plot the spectrogram and visualize the data however despite setting frequency limits the 10MHz frequency content wouldnot be displayed and also time axis I believe is not right.I believe there is no consistency in both the data.could you tell why its happening.

folder = 'C:\Users\Min\Desktop\New folder (2)\New folder (2)';

filename = '240mvp1.csv';

data = readtable(fullfile(folder, filename));

t = table2array(data(3:end, 1));

x = table2array(data(3:end, 2));

time_resolution = t(end)-t(1);

fs = 1/mean(diff(t));

pspectrum(x,fs,'spectrogram', ...

'FrequencyLimits',[1e5 7e6],'TimeResolution',time_resolution,'OverlapPercent',90)

% Customize the plot

xlabel('Time (s)');

ylabel('Frequency (MHz)');

colormap("jet")

title('Spectrogram');

colorbar;

Star Strider 2024-7-16,16:14

此评论的直接链接

https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3212768

  • 链接

    此评论的直接链接

    https://ww2.mathworks.cn/matlabcentral/answers/2137168-i-enabled-fft-function-in-oscillioscope-and-it-saved-the-data-as-fft-amplitude-dbv-and-frequency-d#comment_3212768

  • 270mvp3.csv
  • 550mvp.csv

Since your signals have a time vector, it is best to use it as an appropriate argument. (The only problem is tthat not all the time values are unique, so I use the resample function to create vectors that will work with pspectrum.) Note that tthis makes the time values the same as the argument times. The time values that pspectrum uses are still a bit strange (in my opinion, I have not explored that in detail) however they represent the time ranges in the argument vectors. I also plotted a sample of the original vectors to get an idea of what they looked like. This is close to the way I use pspectrum (generally using the default arguments, though).

Try this —

files = dir('*.csv');

for k = 1:numel(files)

filename = files(k).name

RL = readlines(filename);

H1 = split(RL(1,:),',');

H2 = split(RL(2,:),',');

data = readtable(filename, 'HeaderLines',2);

t = data{:,1};

x = data{:,2};

% time_resolution = t(end)-t(1);

% time_resolution = mean(diff(t));

zxi = find(diff(sign(x)));

fs = 1/mean(diff(t))

[xr, tr] = resample(x, t, fs);

figure

plot(tr, xr)

grid

xlabel('t')

ylabel('Volt')

title(filename)

xlim([-1 1]*2E-6)

figure

% pspectrum(x,fs,'spectrogram', ...

% 'FrequencyLimits',[1e5 7e6],'TimeResolution',time_resolution,'OverlapPercent',90)

pspectrum(xr, tr, 'spectrogram', 'FrequencyLimits',[1e5 7e6], 'OverlapPercent',90)

% Customize the plot

xlabel('Time (s)');

ylabel('Frequency (MHz)');

colormap("jet")

title('Spectrogram');

colorbar;

end

filename = '270mvp3.csv'

fs = 1.0015e+07

I enabled fft function in oscillioscope and it saved the data as FF... (16)

I enabled fft function in oscillioscope and it saved the data as FF... (17)

filename = '550mvp.csv'

fs = 39980000

I enabled fft function in oscillioscope and it saved the data as FF... (18)

I enabled fft function in oscillioscope and it saved the data as FF... (19)

.

请先登录,再进行评论。

更多回答(0 个)

请先登录,再回答此问题。

另请参阅

类别

Signal ProcessingSignal Processing ToolboxDigital and Analog FiltersMultirate Signal Processing

Help CenterFile Exchange 中查找有关 Multirate Signal Processing 的更多信息

标签

  • signal processing
  • fft
  • data acquisition

Community Treasure Hunt

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

Start Hunting!

发生错误

由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。


Translated by I enabled fft function in oscillioscope and it saved the data as FF... (20)

I enabled fft function in oscillioscope and it saved the data as FF... (21)

选择网站

选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:

您也可以从以下列表中选择网站:

美洲

欧洲

亚太

联系您当地的办事处

I enabled fft function in oscillioscope and it saved the data as FF... (2024)

FAQs

What is the FFT function in an oscilloscope? ›

Using the FFT math function on a time domain signal provides the user with frequency domain information and can provide the user a different view of the signal quality, resulting in improved measurement productivity when troubleshooting a device-under-test. Examples include: Analyze harmonics in power lines.

What does the FFT function do? ›

In signal processing, FFT forms the basis of frequency domain analysis (spectral analysis) and is used for signal filtering, spectral estimation, data compression, and other applications. Variations of the FFT such as the short-time Fourier transform also allow for simultaneous analysis in time and frequency domains.

What does an FFT graph tell you? ›

Frequency-domain graphs– also called spectrum plots and Fast Fourier transform graphs (FFT graphs for short)- show which frequencies are present in a vibration during a certain period of time.

What is the best explanation of FFT? ›

As mentioned, Fourier analysis transforms signals from the time domain to the frequency domain. But more correctly, FFT analysis is a mathematical method for transforming a finite time function of equally spaced time samples into a function of frequency of equally spaced complex frequency samples (see reference 5.3).

Why is FFT so important? ›

It converts a signal into individual spectral components and thereby provides frequency information about the signal. FFTs are used for fault analysis, quality control, and condition monitoring of machines or systems.

What is the idea behind FFT? ›

The FFT is an efficient algorithm for computing the DFT. The core idea behind FFT is re-expressing Fourier Matrices as the product of 3 (sparse) matrices, given below. Re-expressing the N by N Fourier Matrix as the product of 3 sparse matrices. Definition of the Permutation matrix, used above.

What is the purpose of the FFT shift function? ›

fftshift (MATLAB Functions) Y = fftshift(X) rearranges the outputs of fft , fft2 , and fftn by moving the zero-frequency component to the center of the array. It is useful for visualizing a Fourier transform with the zero-frequency component in the middle of the spectrum.

What does FFT mean in frequency? ›

FFT – Fast Fourier Transform – is a mathematical technique for converting a signal from the time domain into the frequency domain. Signals on a flaw detector, on an oscilloscope or on an acoustic emission display are typically time domain signals showing how the amplitude varies with time.

What is the FFT of a digital signal? ›

The FFT operates by decomposing an N point time domain signal into N time domain signals each composed of a single point. The second step is to calculate the N frequency spectra corresponding to these N time domain signals. Lastly, the N spectra are synthesized into a single frequency spectrum.

What is the Fourier transform signal function? ›

Fourier Transform is a mathematical model which helps to transform the signals between two different domains, such as transforming signal from frequency domain to time domain or vice versa. Fourier transform has many applications in Engineering and Physics, such as signal processing, RADAR, and so on.

Top Articles
Latest Posts
Article information

Author: Edwin Metz

Last Updated:

Views: 5261

Rating: 4.8 / 5 (58 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Edwin Metz

Birthday: 1997-04-16

Address: 51593 Leanne Light, Kuphalmouth, DE 50012-5183

Phone: +639107620957

Job: Corporate Banking Technician

Hobby: Reading, scrapbook, role-playing games, Fishing, Fishing, Scuba diving, Beekeeping

Introduction: My name is Edwin Metz, I am a fair, energetic, helpful, brave, outstanding, nice, helpful person who loves writing and wants to share my knowledge and understanding with you.