Problems with signal processing

9 Ansichten (letzte 30 Tage)
Dan Lecoutre
Dan Lecoutre am 24 Mär. 2023
Kommentiert: Star Strider am 28 Mär. 2023
I have a signal as shown here:
The x axis is just the sample number and the y is the ampltiude of the signal in volts.
There are ten 'bursts' where the amplitude of the signal spikes and dies out before rising again. I would like to obtain the fast fourier transform of each of these 10 bursts individually and plot them on the same figure. I'm not entirely sure where to start and any help would be greatly appreciated.

Antworten (1)

Star Strider
Star Strider am 24 Mär. 2023
For a time-frequency plot, I would use the pspectrum function with the 'spectrogram' option, at least for an initial approach, although that might be all you need. (The pspectrum results are a bit easier to interpret than the spectrogram results.)
  6 Kommentare
Dan Lecoutre
Dan Lecoutre am 28 Mär. 2023
I have attached the first spike in the data, I have the sampling frequency already. The data contains the amplitude in volts for each recorded sample of the first burst. Would the pspsectrum function be able to plot the frequency against the magnitude in volts?
Star Strider
Star Strider am 28 Mär. 2023
Here are three ways of depicting it, demonstrating the time-frequency characteristics of the spike —
LD = load(websave('burst1%20of%20data','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1338969/burst1%20of%20data.mat'));
burst1 = LD.burst1;
Fs = 1; % Assume Default Sampling Frequency (Value NMot Provided)
[p,f,t] = pspectrum(burst1, Fs, 'spectrogram');
figure
waterfall(f,t,p.')
set(gca,XDir="reverse",View=[60 60])
ylabel("Time (s)")
xlabel("Frequency (Hz)")
xlim([0 Fs*0.01])
ylim([0 max(ylim)/3])
colormap(turbo)
figure
surfc(f,t,p.', 'EdgeColor',[1 1 1]*0.5)
set(gca,XDir="reverse",View=[60 30])
ylabel("Time (s)")
xlabel("Frequency (Hz)")
xlim([0 Fs*0.01])
ylim([0 max(ylim)/3])
colormap(turbo)
figure
contourf(f,t,p.')
set(gca,XDir="reverse")
ylabel("Time (s)")
xlabel("Frequency (Hz)")
xlim([0 Fs*0.005])
ylim([max(ylim)/10 max(ylim)/4])
colormap(turbo)
It would help to have the sampling frequency (I did not find it anywhere) however the plots should scale with it.
Ths Z-axis units are in terms of power, not decibels. Use the pow2db function to convert them, if desired.
.

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by