# 2.2 Short time fourier transform

 Page 1 / 1
Introduction to the Short Time Fourier Transform, which includes it's definition and methods for its use.

## Short time fourier transform

The Fourier transforms (FT, DTFT, DFT, etc. ) do not clearly indicate how the frequency content of a signal changes over time.

That information is hidden in the phase - it is not revealed by the plot of the magnitude of the spectrum.

To see how the frequency content of a signal changes over time, we can cut the signal into blocks and compute thespectrum of each block.
To improve the result,
• blocks are overlapping
• each block is multiplied by a window that is tapered at its endpoints.
Several parameters must be chosen:
• Block length, $R$ .
• The type of window.
• Amount of overlap between blocks. ( )
• Amount of zero padding, if any.

The short-time Fourier transform is defined as

$X(, m)=(\mathrm{STFT}(x(n)), \mathrm{DTFT}(x(n-m)w(n)))=\sum_{n=()}$ x n m w n n n 0 R 1 x n m w n n
where $w(n)$ is the window function of length $R$ .
• The STFT of a signal $x(n)$ is a function of two variables: time and frequency.
• The block length is determined by the support of the window function $w(n)$ .
• A graphical display of the magnitude of the STFT, $\left|X(, m)\right|$ , is called the spectrogram of the signal. It is often used in speech processing.
• The STFT of a signal is invertible.
• One can choose the block length. A long block length will provide higher frequency resolution (because the main-lobeof the window function will be narrow). A short block length will provide higher time resolution because lessaveraging across samples is performed for each STFT value.
• A narrow-band spectrogram is one computed using a relatively long block length $R$ , (long window function).
• A wide-band spectrogram is one computed using a relatively short block length $R$ , (short window function).

## Sampled stft

To numerically evaluate the STFT, we sample the frequency axis  in $N$ equally spaced samples from $=0$ to $=2\pi$ .

$\forall k, 0\le k\le N-1\colon {}_{k}=\frac{2\pi }{N}k$
We then have the discrete STFT,
$({X}^{d}(k, m), X(\frac{2\pi }{N}k, m))=\sum_{n=0}^{R-1} x(n-m)w(n)e^{-(in)}=\sum_{n=0}^{R-1} x(n-m)w(n){W}_{N}^{-(kn)}={\mathrm{DFT}}_{N}((n, \left[0 , R-1\right], x(n-m)w(n)), \text{0,0})$
where $\text{0,0}$ is $N-R$ .

In this definition, the overlap between adjacent blocks is $R-1$ . The signal is shifted along the window one sample at a time. That generates more points than is usuallyneeded, so we also sample the STFT along the time direction. That means we usually evaluate ${X}^{d}(k, Lm)$ where $L$ is the time-skip. The relation between the time-skip, the number ofoverlapping samples, and the block length is $\mathrm{Overlap}=R-L$

Match each signal to its spectrogram in .

## Spectrogram example

The matlab program for producing the figures above ( and ).

% LOAD DATA load mtlb; x = mtlb; figure(1), clf plot(0:4000,x) xlabel('n') ylabel('x(n)') % SET PARAMETERS R = 256; % R: block length window = hamming(R); % window function of length R N = 512; % N: frequency discretization L = 35; % L: time lapse between blocks fs = 7418; % fs: sampling frequency overlap = R - L; % COMPUTE SPECTROGRAM [B,f,t] = specgram(x,N,fs,window,overlap); % MAKE PLOT figure(2), clf imagesc(t,f,log10(abs(B))); colormap('jet') axis xy xlabel('time') ylabel('frequency') title('SPECTROGRAM, R = 256')

## Effect of window length r

Here is another example to illustrate the frequency/time resolution trade-off (See figures - , , and ).

## Effect of l and n

A spectrogram is computed with different parameters: $L\in \{1, 10\}$ $N\in \{32, 256\}$

• $L$ = time lapse between blocks.
• $N$ = FFT length (Each block is zero-padded to length $N$ .)
In each case, the block length is 30 samples.

For each of the four spectrograms in can you tell what $L$ and $N$ are?

$L$ and $N$ do not effect the time resolution or the frequency resolution. They only affect the'pixelation'.

## Effect of r and l

Shown below are four spectrograms of the same signal. Each spectrogram is computed using a different set of parameters. $R\in \{120, 256, 1024\}$ $L\in \{35, 250\}$ where

• $R$ = block length
• $L$ = time lapse between blocks.

For each of the four spectrograms in , match the above values of $L$ and $R$ .

If you like, you may listen to this signal with the soundsc command; the data is in the file: stft_data.m . Here is a figure of the signal.

Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
hi
Loga
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!