0% found this document useful (0 votes)
57 views13 pages

SSP 3 2 - Spectrum 2

The document provides an outline and overview of topics related to spectral estimation, including: 1. A review of classical spectral estimation techniques like the periodogram and how they can be improved through tapering and averaging. 2. An introduction to multitaper spectral estimation, which uses multiple tapers or windows to reduce the bias and variance of spectral estimates. 3. A discussion of techniques for analyzing non-stationary signals, including the short-time Fourier transform and time-frequency representations.

Uploaded by

Gabor Gereb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views13 pages

SSP 3 2 - Spectrum 2

The document provides an outline and overview of topics related to spectral estimation, including: 1. A review of classical spectral estimation techniques like the periodogram and how they can be improved through tapering and averaging. 2. An introduction to multitaper spectral estimation, which uses multiple tapers or windows to reduce the bias and variance of spectral estimates. 3. A discussion of techniques for analyzing non-stationary signals, including the short-time Fourier transform and time-frequency representations.

Uploaded by

Gabor Gereb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Outline

1 Introduction

2 Review of spectral estimation


IN5340 / IN9340 Lecture 7 3 Multitaper spectral estimation
Spectral Estimation II Difficult case: Single tone in non-flat spectrum

4 Estimation of the Magnitude Squared Coherence (MSC)

5 Spectral analysis of non-stationary signals


Roy Edgar Hansen February 2022 Short Time Fourier Transform (STFT)
Time-frequency representation examples
Second order Time-Frequency representations

6 Summary

1 / 50

What do we learn What do we learn (2)


Multitaper spectral estimation Non-stationary signals, Time-frequency analysis
Estimation of the Magnitude Squared Coherence The Short Time Fourier Transform (the spectrogram)
D. B. Percival and A. T. Walden. L. Cohen.
Spectral Analysis for Univariate Time Series. Time-Frequency Analysis: Theory and Applications.
Cambridge University Press, 2020. Prentice Hall, 1994.
S. M. Alessio. P. Flandrin.
Digital Signal Processing and Spectral Analysis for Scientists: Concepts and Applications. Time-Frequency/Time-Scale Analysis.
Springer, 2016. Academic Press, 1999.
URL https://link.springer.com/book/10.1007/978-3-319-25468-5. B. Boashash.
D. J. Thomson. Time-Frequency Signal Analysis and Processing: A Comprehensive Reference.
Spectrum estimation and harmonic analysis. Academic Press, 2nd edition, 2015.
Proceedings of the IEEE, 70(9):1055–1096, September 1982. F. Auger, P. Flandrin, Patrick Flandrin François Auger, Y.-T. Lin, S. McLaughlin, S. Meignen, T. Oberlin, and
J. S. Bendat and A. G. Piersol. H.-T. Wu.
Engineering Applications of Correlation and Spectral Analysis. Time-Frequency Reassignment and Synchrosqueezing.
John Wiley & Sons, 1980. IEEE Signal Processing Magazine, 30(6):32–41, November 2013.

2 / 50 3 / 50
Additional material Review of spectral estimation
Matlab manual: Multitaper power spectral density estimate Classical spectral estimation is Fourier based spectral estimation
Multitaper on wikipedia The periodogram is the Fourier transform of the biased autocorrelation estimate
Barry Van Veen on youtube: Estimation of Coherence and Cross spectra The periodogram spectral estimator suffers from unacceptable bias and variance
Matlab manual: Time-Frequency Analysis Bias can be reduced by tapering
Short Time Fourier Transform and Spectrogram on Wikipedia Variance can be reduced by averaging or smoothing
Time Frequency Toolbox: tftb.nongnu.org There is a trade-off between:
Variance reduction and spectral resolution
Large Time-Frequency Analysis Toolbox (LTFAT):
Bias reduction and spectral resolution
ltfat.sourceforge.net, sourceforge.net/projects/ltfat/
Bias and variance performance
Sverre Holm: Master thesis on Spectral analysis of sunspot data
https://www.mn.uio.no/fysikk/studier/master/masteroppgaver/
ELITE : signalbehandling og avbildning : spectral analysis of sunspot data
4 / 50 5 / 50

The modified periodogram: Bias reduction by tapering Welch’s method: Variance reduction by averaging
Bias can be reduced by applying tapering (or windowing). Variance can be reduced by averaging multiple modified periodograms.
At the cost of loss in spectral resolution. Does not affect variance. At the cost of loss in spectral resolution. Does not affect bias.
Bias due to sidelobes is referred to as spectral leakage. More or less equivalent to spectral smoothing.

6 / 50 7 / 50
Frequency resolution Multitaper spectral estimation
Inspired by the success of tapering and averaging, one could construct a new spectral estimator
The Periodogram is the Fourier based spectral estimator with best spectral resolution
2 as follows:
N −1

1 X
−j ω n
P̂xx (ω) = x (n)e multitaper algorithm
N


n=0
1 Construct several different tapers of size N (full size)
In frequency estimation (different from spectral estimation), this technique can be used
2 Ensure that the tapers are properly designed orthogonal functions
Assume a harmonic signal in additive white Gaussian noise 3 Produce modified periodograms using each taper (with low bias)
x (n) = A cos(ω0 n + ϕ) + w (n) 4 Average (with or without weighting) to reduce variance
with unknown amplitude A, frequency ω0 and phase ϕ.
Within certain bounds, maximizing the Periodogram is approximately the optimal frequency First suggested by Thomson in 1982
estimator Windows based on Discrete Prolate Spheroidal Sequences
It is the Maximum Likelihood Estimator (MLE), and attains the Cramér-Rao lower bound Matlab function pmtm for multitaper spectral estimator
(CRLB) asymptotically (for large N or SNR).
Matlab function dpss to produce the tapers
8 / 50 9 / 50

Multitaper spectral estimation Discrete Prolate Spheroidal Sequences (DPSS)


Assume a sequence of data x (n) of size N, and a set of K different tapers Discrete Prolate Spheroidal Sequences (DPSS) are optimal tapers
The multitaper spectral estimator is DPSS are, however, complicated to construct (from scratch)
2
N −1

(m , k ) 1 X
−j ω n
Simple in Matlab: [e,v] = dpss(1000,2);
P̂xx (ω) = x (n)wk (n)e
N


n=0
K −1
(mt ) 1 X (m , k )
P̂xx (ω) = P̂xx (ω)
K
k =0

Each taper wk (n) must have low sidelobe level to prevent bias
(m,k )
The individual modified periodograms P̂xx (ω) must be pairwise uncorrelated such that
averaging reduces variance

10 / 50 11 / 50
Discrete Prolate Spheroidal Sequences (DPSS) Poor-mans multitapers
A simpler set of orthonormal tapers can be constructed from sinusoidal tapers (Reidel and
Design criterum: Choose the window function w (n) to obtain a transformed window W (ω)
Sidorenko 1995)
which maximizes
  r
main lobe energy 2 π(k + 1)(n + 1)
max wk (n) = sin
w total energy N +1 N +1
No closed form solution
The DPSS are eigenfunctions with corresponding eigenvalues solving the integral equation
The Kaiser window is a simple approximation of the 0th order DPSS using Bessel functions
Orhtogonality between the tapers ensures that variance is reduced
See Window function on Wikipedia, and DPSS in the Matlab manual

12 / 50 13 / 50

Performance of multitaper spectral estimation Performance of multitaper spectral estimation


Example: ARMA random process with large dynamic range Example: Single sinusoid in Additive White Gaussian Noise

14 / 50 15 / 50
Difficult case: Single tone in non-flat spectrum Example: Single tone in non-flat spectrum
Periodogram:
Create a single realisation of non-white noise by filtering WGN
P_per = 1/n .* abs(fft(x)).^2;
Add a transient single tone signal with low amplitude

Model Code
n = 1024*8; b = 1;
a = [1 -0.99, 0.9]; % Filter parameters
[h,faxe_m] = freqz(b,a,n); % Model spectrum
faxe_m = faxe_m / (2*pi);
P_model = abs(h).^2;

M = 1000; L = 100;
w = randn(L+n,1); % WGN
x = filter(b,a,w); % Filtered noise
x = x(L+1:L+n); % remove transient

% Signal - single sinusoid


z = sin( 2*pi*[0:n-1]’ * 0.2341 + 0.96352 );

% Apply a window to widen the spectrum


z(1:n/2-M) = 0; z(n/2+M:end) = 0;
z(n/2-M:n/2+M) = z(n/2-M:n/2+M) .* kaiser(2*M+1,6.5);
x = x + 0.65*z; % Sum noise and signal
16 / 50 17 / 50

Example: Single tone in non-flat spectrum Example: Single tone in non-flat spectrum
Welch’s method: Multitaper method:
[P_welch, faxe_w] = pwelch( x, kaiser(1024,5.5), 1024/4*3 ); [P_mtm,faxe_mtm] = pmtm(x,4);

18 / 50 19 / 50
Example: Single tone in non-flat spectrum: Zoomed Classical spectral estimation - Summary
The Welch and the multitaper method reduces variance and improves detectability The Periodogram:
The Fourier transform of the biased autocorrelation estimate.
The multitaper technique gives better sampling of the peak than Welch method Suffers from poor bias and variance. Good spectral resolution
The modified periodogram
Windowed (tapered) periodogram.
Bias reduced, Variance not reduced. Trade-off between spectral resolution and bias reduction.
Welch’s method (WOSA)
Divide data into small sections and estimate the spectrum.
Bias reduced, Variance reduced, Consistent.
Heavy trade-off between spectral resolution and Variance reduction.
Thomson’s multitaper method
Apply different windows of full length and estimate the spectrum.
Bias reduced, Variance reduced, Consistent.
Also trade-off between spectral resolution and Variance reduction.
20 / 50 21 / 50

Estimation of the Magnitude Squared Coherence The MSC and the Periodogram 1
Magnitude squared coherence (MSC) Consider two zero mean WSS random sequences x (n) and y (n)
|Pxy (ω)|2 The periodogram
|Γxy (ω)|2 = , 0 ≤ |Γxy (ω)|2 ≤ 1
Pxx (ω)Pyy (ω) 1 1
P̂xx (ω) = XN∗ (ω)XN (ω) = |XN (ω)|2
Requires Pxx (ω) > 0 and Pyy (ω) > 0 N N
where XN (ω) is the discrete Fourier transform of x (n)
Frequency domain analog of the correlation coefficient
Correspondingly for y (n)
Assess the relationship between two signals in frequency domain
1 1
P̂yy (ω) = YN∗ (ω)YN (ω) = |YN (ω)|2
Can be used to prove linear dependence N N
Reference: Bendat & Piersol 1980 The periodogram estimator of the cross spectrum
1
How to estimate it? Similar procedure as for the PSD. P̂xy (ω) = XN∗ (ω)YN (ω)
N
Barry Van Veen on youtube: Estimation of Coherence and Cross spectra

22 / 50 23 / 50
The MSC and the Periodogram 2 Estimating the MSC
Inserting into the MSC Use a better spectral estimator instead of the periodogram
Suggestion: use the Welch overlapped segment averaging
|P̂xy (ω)|2
|Γ̂xy (ω)|2 = K −1
P̂xx (ω)P̂yy (ω) (w ) 1 X (m,i )
P̂xx (ω) = P̂xx (ω)
|XN∗ (ω)YN (ω)|2 XN∗ (ω)YN (ω) XN (ω)YN∗ (ω) K
i =0
= = =1
XN∗ (ω)XN (ω) YN∗ (ω)YN (ω) XN∗ (ω)XN (ω) YN∗ (ω)YN (ω) (m,i )
P̂xx (ω) is the i-th modified periodogram
2 (w ) (w )
The MSC is estimated to |Γ̂xy (ω)| = 1, independent of data Correspondingly for P̂yy and P̂xy
From Manolakis, p239: The frequency domain correlation coefficient at each frequency is Inserting into the MSC
estimated using only one single pair of observations from the two signals. (w )
|P̂xy (ω)|2
|Γ̂xy (ω)|2 =
The periodogram cannot be used in estimating the MSC (w )
P̂xx (ω)P̂yy (ω)
(w )

This is the approach for the matlab function mscohere


Studied by G Clifford Carter et al in IEEE Transactions on Audio and Electroacoustics in 1973
24 / 50 25 / 50

Example MSC estimation using Welch Spectral analysis of non-stationary signals


What happens when the signals are non-stationary?
The autocorrelation function is no longer a function of lag only
Non-trivial problem
Simple intuitive approach:
1 Break the timeseries into segments that are locally WSS
2 Estimate the spectrum for each segment

This is then a time-frequency representation


Different approaches to time-frequency analysis:
Short Time Fourier Transform
Second order time-frequency analysis (Cohen class)
Wavelet analysis

26 / 50 27 / 50
Example time-frequency representation Short time Fourier transform
Divide the total sequence of N data samples into
segments of size L, and offset each segment by D
points into a total number of K segments such that
N = L + D (K − 1)
The Short Time Fourier Transform is
L− 1
X
STFT(i , ω) = x (n + iD )w (n)e−j ωn
n =0
where w (n) is a window of choice.
Note the similarity with Welch’s method of
periodogram averaging
Also known as sliding window Fourier transform
From wikipedia.org
The spectrogram is commonly known as the magnitude squared STFT
28 / 50 29 / 50

Short time Fourier transform Time and frequency resolution in the STFT
The STFT can be generalised to use any Fourier based spectral estimator
The uncertainty principle states that the time duration ∆t and frequency bandwidth ∆ω are
Example: Spectrogram based on the modified periodogram related by
2
1
L−1
1 X
∆t ∆ω ≥
P̂xx (t , ω) = x (n + iD )w (n)e−j ωn , t = (i + D /2)δ t

L 2
n =0
A fundamental property of the Fourier transform pair s(t ) and S (ω)
where δ t is the sampling interval
Derived by Heisenberg in 1927 in quantum mechanics (for position and momentum)
See spectrogram, stft, istft in Matlab

Caution
STFTs should really be viewed as a stack of individual spectral estimates. To construct a
proper density P (t , ω) as a function of time and frequency, energy conservation has to be
taken into account. This is not the case for STFT-based representations.
Werner Heisenberg
theoretical physicist
Nobel prize 1932
From wikipedia
30 / 50 31 / 50
Time and frequency resolution in the STFT Example: STFT of FM signal
The time-frequency resolution relation leads to the following: Consider a simple deterministic mono-component signal
Better frequency resolution requires larger time duration and thereby lower time resolution a1
s(t ) = a(t )ej ϕ(t ) , ϕ(t ) = ω0 t + cos(ω1 t )
Better time resolution requires shorter time duration and thereby lower frequency resolution ω1

The instantaneous frequency


is defined as
d ϕ(t )
ωIF (t ) ≡
dt
For our signal, the IF
becomes
ωIF (t ) = ω0 − a1 sin(ω1 t )

32 / 50 33 / 50

The effect of choosing segment size L Comments on choosing segment size


Example: STFT of FM signal
The first spectrogram has a long time window L = 512
During the window length, the frequency changes
This causes smearing which appears as poorer resolution
in the frequency domain
The last spectrogram has a short time window L = 64
Here, we observe “true” lowering of the spectral resolution
due to window length
This example shows the importance of window length in the
time-frequency representation

34 / 50 35 / 50
A dirty trick: Zeropadding Zeropadding example: STFT of FM signal
A simple trick to get smoother spectral representation is zeropadding
Zeropadding is adding zeros in the sequence to be FT ed
Done in Matlab for you: fft(x, N) will zeropad the sequence x to a total of N elements
before FT is applied

Zeropadding code example


N = 16; ii = 3;
NN = N * 2^(ii-1); % Number of samples (including zeropadding)
xax = [-NN/2:NN/2-1]/NN; % Proper x-axis for plotting
X = 1/N*abs(fftshift(fft( ones(N,1), NN ))); % Rectangular window

36 / 50 37 / 50

Time-frequency representation of sonar data Time-frequency representation of sonar data


Short Time Fourier Transform of single ping of sonar rawdata
Sidescan Sonar image
Modified periodogram with Kaiser 4.5 window and zeropadding
Pulse echo image of the seabed
One range line per ping
100 kHz center frequency
LFM waveform transmitted
Pulse compression applied
Beamforming applied
Time varying gain applied

Data collected by HUGIN AUV carrying a HISAS


interferometric synthetic aperture sonar

38 / 50 39 / 50
Example: Human voice Example: Hydrophone data

Data from the Lofoten - Vesterålen (LoVe) Ocean Observatory hydrophone.


A spectrogram (0-5000 Hz) of the sentence "it’s all Greek to me" spoken by a female voice. Data taken 2018-01-21.
From wikipedia.org From love.statoil.com (with help from Lars Ødegaard, FFI)
40 / 50 41 / 50

Example: Whale song Example: Bat echolocation


Spectrogram showing an FM
echolocation sound (one click) of the
big brown bat.
Non-linear FM sweep
Downwards
Large bandwidth 20 kHz - 110 kHz
4 visible harmonics

Data from the Lofoten - Vesterålen (LoVe) Ocean Observatory hydrophone. Data taken 2018-01-21, approximately 06:00
Audio demo From scholarpedia.org
42 / 50 43 / 50
Second order Time-frequency representations Second order Time-frequency representations
The uncertainty principle limits directly the ability to resolve transient This approach has a number of desirable properties
frequencies in the STFT It obtains “full” resolution for LFM type signals
It is energy preserving (and as such a proper distribution)
How do we approach this?
It does however, produce cross terms (ghosts)
We capture the time variantion (non-stationarity) into a time-varying
A generalised form (referred to as Cohen’s class) is
autocorrelation function
C (t , ω) = W (t , ω) ∗ Φ(t , ω)
Rxx (t , τ ) = x (t + τ /2)x ∗ (t − τ /2)
where the kernel function Φ(t , ω) can be chosen
and directly transform into time-frequency domain
The generalised form describe any time-frequency representation (including STFT)
The Wigner-Ville distribution does this
By choosing the kernel function, the cross terms can be supressed at the cost of loss in
Z
W (t , ω) = x (t + τ /2)x ∗ (t − τ /2)e−j ωτ d τ resolution
Eugene Wigner
Introduced by Wigner in 1932 in quantum mechanics, and introduced to physicist / mathematican Time-Frequency Toolbox for Matlab: http://tftb.nongnu.org/
Nobel prize 1963
signal analysis by Ville in 1948 From wikipedia
wvd in matlab signal processing toolbox
44 / 50 45 / 50

Time-frequency representation of a LFM signal Time-frequency representation of a FM signal


Left: Short-Time Fourier Transform (STFT). Right: Wigner-Ville distribution of LFM signal Left: Short-Time Fourier Transform (STFT). Right: Wigner-Ville distribution of LFM signal

46 / 50 47 / 50
Time-frequency representation of a FM signal Fourier synchrosqueezed transform
Choi-Williams distribution
New approach that treats the problems with the STFT and second order T-F methods.
Uses phase to sharpen up the T-F representation, and is invertible.
In matlab: fsst, ifsst, Signal Analyzer
See also (in matlab): spectrogram, pspectrum and reassigned

Auger et al. Time-Frequency Reassignment and Synchrosqueezing. IEEE Signal Processing Magazine November 2013
48 / 50 49 / 50

Summary of lecture VII


List of terms from this lecture
Spectral estimation and classical spectral estimation
Multitaper spectral estimation Roy Edgar Hansen
Non-stationary signals
Time-frequency analysis IN5340 / IN9340 Lecture 7
Spectral Estimation II
Short Time Fourier Transform (STFT)
Spectrogram
Uncertainty principle
Instantaneous frequency
Second order time-frequency relations

50 / 50

You might also like