MATLAB Answers

How to perform a zoom FFT on certain portion of a signal

33 views (last 30 days)
I have a signal with a sample rate of 200HZ, see attached. I am interested in a certain portion of the signal, so I zoomed in that section from the original signal (see figure below). I want to compute FFT (maybe zoom FFT) on that portion to see the frequencies within that region. Please I need help, thank you.

  2 Comments

Matt Gaidica
Matt Gaidica on 25 Jan 2021
@Star Strider has you covered on the FFT. I would offer that unless your hypothesis is that this phenomenon is rhythmic, an FFT may not be what you want. If your question is, rather, about how many times does my subject spawn over some amount of time, I think you would want to identify peaks in your data and come up with a mean rate (i.e. occurences / time). See also peakseek.
Austin Ukpebor
Austin Ukpebor on 26 Jan 2021
Matt, your contributions on this platform and privately are a great deal to the success of my project. Thank you.

Sign in to comment.

Accepted Answer

Star Strider
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.

  7 Comments

Show 4 older comments
Star Strider
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.)
.
Austin Ukpebor
Austin Ukpebor on 26 Jan 2021
You are absolutely right, those are harmonics. I learned a lot from your contributions. Thank you.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!