33 views (last 30 days)

Star Strider
on 23 Jan 2021

First, see if the pspectrum funciton using the 'spectrogram' option will do what you want. It will segment the Fourier transform as a function of time as well as frequency. You can then easily see how the frequency content changes over time.

If that does not do what you want, please be a bit more specific.

Star Strider
on 25 Jan 2021

I do not know enough about oyster physiology to comment on that plot. However, it would appear to be a fundamental frequency of 20 Hz (which seems to me to be quite fast for a physiologic process other than perhaps nerve or muscle membrane depolarization), and the rest are harmonics of the fundamental frequency, every 20 Hz.

I would be tempted to do something like this:

D1 = readmatrix('sensor4.csv');

Fs = 200; % Sampling Frequency (Hz)

figure

[p,f,t] = pspectrum(D1, Fs, 'spectrogram');

freq = 20;

p20 = interp1(f,p,freq);

plot(t, p20)

grid

xlabel('Time (s)')

ylabel('Power')

title(sprintf('Signal at %6.1f Hz As Function Of Time', freq))

That plots the 20 Hz power ‘slice’ of the pspectrum 'spectrogram' as a function of time. (The choice of frequencies is arbitrary, and is controlled by the third argument (‘freq’) of the interp1 call.)

.

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

Start Hunting!
## 2 Comments

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/724977-how-to-perform-a-zoom-fft-on-certain-portion-of-a-signal#comment_1285873

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/724977-how-to-perform-a-zoom-fft-on-certain-portion-of-a-signal#comment_1285873

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/724977-how-to-perform-a-zoom-fft-on-certain-portion-of-a-signal#comment_1287373

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/724977-how-to-perform-a-zoom-fft-on-certain-portion-of-a-signal#comment_1287373

Sign in to comment.