MATLAB Time-frequency analysis (short-time Fourier transform, STFT)

Source: Internet
Author: User
Tags local time sin

Short-time Fourier transform, short-time Fourier transformation, sometimes called the window Fourier transform, the time window makes the signal only in a certain small interval, which avoids the traditional Fourier transform in the time-frequency local expression ability of the insufficiency, The Fourier transform has the ability of local localization. 1. Stft under the Spectrogram:matlab

How can I compute a short-time Fourier transform (STFT) in MATLAB?

Stft differs from ft in that it is more of a concept of time, to signal y=sin (128⋅π⋅t) +sin (256⋅π⋅t) y=\sin (128\cdot \pi\cdot t) +\sin (256\cdot\pi\cdot t) (2πft⇒f 2\ Pi Ft⇒f is a frequency) for short-time Fourier transforms with 64 and 1282 of these analog signals.

FS = +;
t = 0:1/fs:2;
y = sin (128*pi*t) + sin (256*pi*t);      

Figure;
WIN_SZ =;
Han_win = Hanning (WIN_SZ);      % Select Hamming window

nfft = WIN_SZ;
Nooverlap = win_sz-1;
[S, F, T] = spectrogram (y, window, Nooverlap, NFFT, FS);

Imagesc (T, F, LOG10 (ABS (S)))
set (GCA, ' ydir ', ' normal ')
Xlabel (' Time (secs) ')
ylabel (' Freq (Hz) ')
title (' Short time Fourier transform Spectrum ')
2. CWT: Continuous wavelet transform

Time-frequency analysis of modulated signals

Wavelet transform further expands the capability of local time-frequency analysis.

[Cfs,f] = cwt (quadchirp, ' bump ', FS);
Helpercwttimefreqplot (cfs,tquad,f, ' surf ', ' CWT ' of quadratic Chirp ', ' Seconds ', ' Hz ')

The choice is bump type wavelet , the reason for selecting this type is that when the signal oscillation is intense, and more attention is paid to the time-frequency analysis of the signal local transients.

Load Quadchirp;
FS = +;
[S,f,t] = Spectrogram (QUADCHIRP,100,98,128,FS);
Helpercwttimefreqplot (s,t,f, ' surf ', ' STFT of quadratic Chirp ', ' Seconds ', ' Hz ')

We can further compare the STFT (short time Fourier transform) and CWT (continuous wavelet transform) in the time-frequency analysis of the refinement of the characterization capabilities.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.