Problems with signal processing

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.

답변 (1개)

Star Strider
Star Strider 2023년 3월 24일

0 개 추천

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

Dan Lecoutre
Dan Lecoutre 2023년 3월 24일
I'm not sure I understand what you mean, how would this function help me?. I am trying to plot a fast fourier transform just of each individual burst. At the moment this is code I am using to plot the fft of the first burst, and I have to manually input the x values for burst1. I'm looking to write some code that will obtain the x values for which each burst starts and ends and then plots the fft of this burst. At the end I would have the fft of each burst on one figure.
Star Strider
Star Strider 2023년 3월 24일
편집: Star Strider 2023년 3월 25일
It displays the Fourier transform of each burst as part of the time-frequency plot.
That will tell you if it is worth analysing further. If so, the stft function would be worth considering.
I have my data vector that is of dimensions 1x24e6
In order to use the pspectrum function on the signal I attached in the first message how would I write the code for the spectrum function?
x=pspectrum(src1.Data);
plot(x);
This is how I am trying to write it but I dont think I'm using the function correctly
Star Strider
Star Strider 2023년 3월 28일
Ideally, it would be something like this —
[p,f,t] = pspectrum(src1.Data, Fs, 'spectrogram')
figure
waterfall(f,t,p)
or something similar, where ‘Fs’ is the sampling frequency. (Most signal processing functions assume that the sampling intervals are the same throughout the signal.) See the documentation for details.
With a vector of that length, it should be possible to get a fair amount of detail.
If you want to post it here, it would be necessary first to use the resample function to downsample it to the required 5 MB length, or to post only the first 5 MB of it, or some 5 MB subsection of it, assuming that contains at least one spike. It looks like there might be two signals in the original plot image, so choose a representative sample of one or both to attach. Use the paperclip icon in the top toolstrip to do that.
Dan Lecoutre
Dan Lecoutre 2023년 3월 28일
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?
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.
.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 AI for Signals에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2023년 3월 24일

댓글:

2023년 3월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by