Statistics, spectral analysis, sampling and decimation

Digital Signal Processing · · dsp, spectral-analysis, sampling, multirate

Contents

This typeset version was assembled by AI from my handwritten solutions. The handwritten PDF is the original source.

Problem 2001

Problem 2001 · CTU BE2M31DSPA exam

What is the formula for evaluation of signal power PxP_x from NN samples of the signal x[n]x[n]? (6 points)

P^x=1N∑n=0N−1(x[n])2\hat{P}_x = \frac{1}{N}\sum_{n=0}^{N-1} \left(x[n]\right)^2

Example: N=5N = 5, P^x=15∑n=04(x[n])2\displaystyle \hat{P}_x = \frac{1}{5}\sum_{n=0}^{4} \left(x[n]\right)^2

Problem 2002

Problem 2002 · CTU BE2M31DSPA exam

What is the formula for evaluation of mean value μx\mu_x from NN samples of the signal x[n]x[n]? (6 points)

μ^n=1N∑n=0N−1x[n]\hat{\mu}_n = \frac{1}{N}\sum_{n=0}^{N-1} x[n]

Problem 2003

Problem 2003 · CTU BE2M31DSPA exam

What is the formula for evaluation of variance σx2\sigma_x^2 from NN samples of the signal x[n]x[n]? (6 points)

σ2=Av[(x[n]−μx)2]  ⇒  σ^2=1N∑n=0N−1(x[n]−μ^x)2\sigma^2 = \mathrm{Av}\left[(x[n] - \mu_x)^2\right] \;\Rightarrow\; \hat{\sigma}^2 = \frac{1}{N}\sum_{n=0}^{N-1} \left(x[n] - \hat{\mu}_x\right)^2

Problem 2004

Problem 2004 · CTU BE2M31DSPA exam

What is the formula for the evaluation of SNR (Signal-to-Noise-Ration) for the mixture of clean signal s[n]s[n] and additive noise n[n]n[n], i.e. x[n]=s[n]+n[n]x[n] = s[n] + n[n]? (6 points)

SNRx=10⋅log⁡10(PsPn),wherePs=1N∑n=0N−1(s[n])2,Pn=1N∑n=0N−1(n[n])2\mathrm{SNR}_x = 10\cdot\log_{10}\left(\frac{P_s}{P_n}\right), \quad\text{where}\quad P_s = \frac{1}{N}\sum_{n=0}^{N-1}\left(s[n]\right)^2, \quad P_n = \frac{1}{N}\sum_{n=0}^{N-1}\left(n[n]\right)^2

Problem 2008

Problem 2008 · CTU BE2M31DSPA exam

In the following figure, the continuous and aperiodic amplitude spectrum is shown. Determine, if analyzed signal was continuous or discrete in the time and if it was periodic or aperiodic. What kind of Fourier transform was used to obtain this spectrum? (6 points)

The figure is on page 2 of the scan.

Continuous in time, aperiodic. Simple old Fourier Transform.

Problem 2008a

Problem 2008a · CTU BE2M31DSPA exam

In the following figure, the discrete and aperiodic amplitude spectrum is shown. Determine, if analyzed signal was continuous or discrete in the time and if it was periodic or aperiodic. What kind of Fourier transform was used to obtain this spectrum? (6 points)

The figure is on page 2 of the scan.

Continuous in time, periodic. FS (Fourier series).

Problem 2008b

Problem 2008b · CTU BE2M31DSPA exam

In the following figure, the continuous and periodic amplitude spectrum is shown. Determine, if analyzed signal was continuous or discrete in the time and if it was periodic or aperiodic. What kind of Fourier transform was used to obtain this spectrum? (6 points)

The figure is on page 2 of the scan.

Discrete in time, aperiodic. ⇒\Rightarrow DTFT

Problem 2008c

Problem 2008c · CTU BE2M31DSPA exam

In the following figure, the discrete and periodic amplitude spectrum is shown. Determine, if analyzed signal was continuous or discrete in the time and if it was periodic or aperiodic. What kind of Fourier transform was used to obtain this spectrum? (6 points)

The figure is on page 3 of the scan.

Discrete in time, periodic. DFT

Problem 2009

Problem 2009 · CTU BE2M31DSPA exam

Random signal n[n]n[n] with Gaussian distribution has the zero-mean value μn=0\mu_n = 0 and variance σn2=0.01\sigma_n^2 = 0.01. Determine, how should the signal be modified to obtain the signal with new variance σn2=0.16\sigma_n^2 = 0.16. The mean value of modified signal should be again equal to. (6 points)

n = sqrt(0.16/0.01)*n

n=0.160.01⋅nn = \sqrt{\frac{0.16}{0.01}}\cdot n

Problem 2009a

Problem 2009a · CTU BE2M31DSPA exam

Random signal n[n]n[n] with Gaussian distribution has the mean value μn=0.1\mu_n = 0.1 and variance σn2=0.01\sigma_n^2 = 0.01. Determine, what is the value of the signal power PnP_n. (6 points)

P^x=0.02\hat{P}_x = 0.02, P^x=σ^2+μ^n2\quad \hat{P}_x = \hat{\sigma}^2 + \hat{\mu}_n^2

Given: σ^2=0.01\hat{\sigma}^2 = 0.01, μ^x=0.1\hat{\mu}_x = 0.1.

σ^2=1N∑n=0N−1(x[n]−μ^x)2\hat{\sigma}^2 = \frac{1}{N}\sum_{n=0}^{N-1}\left(x[n] - \hat{\mu}_x\right)^2σ^2=1N[(x[0]−μ^x)2+(x[1]−μ^x)2+⋯+(x[N−1]−μ^x)2]\hat{\sigma}^2 = \frac{1}{N}\left[\left(x[0] - \hat{\mu}_x\right)^2 + \left(x[1] - \hat{\mu}_x\right)^2 + \dots + \left(x[N-1] - \hat{\mu}_x\right)^2\right]σ^2=1N[(x[0]2−2x[0]μ^x+μ^x2)+(x[1]2−2x[1]μ^x+μ^x2)+⋯+(x[N−1]2−2x[N−1]μ^x+μ^x2)]\hat{\sigma}^2 = \frac{1}{N}\left[\left(x[0]^2 - 2x[0]\hat{\mu}_x + \hat{\mu}_x^2\right) + \left(x[1]^2 - 2x[1]\hat{\mu}_x + \hat{\mu}_x^2\right) + \dots + \left(x[N-1]^2 - 2x[N-1]\hat{\mu}_x + \hat{\mu}_x^2\right)\right]

Now, group the like terms:

σ^2=1N[(x[0]2+x[1]2+⋯+x[N−1]2)−(2μ^xx[0]+2μ^xx[1]+⋯+2μ^xx[N−1])+(N⋅μ^x2)]\hat{\sigma}^2 = \frac{1}{N}\left[\left(x[0]^2 + x[1]^2 + \dots + x[N-1]^2\right) - \left(2\hat{\mu}_x x[0] + 2\hat{\mu}_x x[1] + \dots + 2\hat{\mu}_x x[N-1]\right) + \left(N\cdot\hat{\mu}_x^2\right)\right]σ^2=1N[x[0]2+x[1]2+⋯+x[N−1]2]⏟P^x−2μ^x⋅1N[x[0]+x[1]+⋯+x[N−1]]⏟μ^x+μ^x2\hat{\sigma}^2 = \underbrace{\frac{1}{N}\left[x[0]^2 + x[1]^2 + \dots + x[N-1]^2\right]}_{\hat{P}_x} - 2\hat{\mu}_x\cdot\underbrace{\frac{1}{N}\left[x[0] + x[1] + \dots + x[N-1]\right]}_{\hat{\mu}_x} + \hat{\mu}_x^2

We have:

σ^2=P^x−2μ^x⋅μ^x+μ^x2⇒P^x=σ^2+2μ^x2−μ^x2answer⇒P^x=σ^2+μ^x2 \begin{aligned} \hat{\sigma}^2 &= \hat{P}_x - 2\hat{\mu}_x\cdot\hat{\mu}_x + \hat{\mu}_x^2 \\ \Rightarrow\quad \hat{P}_x &= \hat{\sigma}^2 + 2\hat{\mu}_x^2 - \hat{\mu}_x^2 \\ \text{answer} \Rightarrow\quad \hat{P}_x &= \hat{\sigma}^2 + \hat{\mu}_x^2 \end{aligned} final answer⇒P^x=0.01+0.01=0.02\boxed{\text{final answer} \Rightarrow \hat{P}_x = 0.01 + 0.01 = 0.02}

Problem 2009b

Problem 2009b · CTU BE2M31DSPA exam

Random signal n[n]n[n] with Gaussian distribution has the power Pn=0.12P_n = 0.12. Determine, what is the value of signal variance σn2\sigma_n^2, when the signal has the zero-mean value μn=0\mu_n = 0. (6 points)

σn=0.12\sigma_n = 0.12

Problem 2009c

Problem 2009c · CTU BE2M31DSPA exam

Random signal n[n]n[n] with Gaussian distribution has the power Pn=0.2P_n = 0.2. Determine, what is the value of signal variance σn2\sigma_n^2, when the signal has the mean value μn=0.2\mu_n = 0.2. (6 points)

σ^2=0.20−0.04=0.16\hat{\sigma}^2 = 0.20 - 0.04 = 0.16

Problem 2201

Problem 2201 · CTU BE2M31DSPA exam

We have quasi-periodic signal with period ToT_\mathrm{o} which is less than number of the signal samples NN, i.e. To<NT_\mathrm{o} < N. How can be detected the periodicity of such signal in short-time DFT spectrum with NN samples? (6 points)

Zero-padding the signal can increase the resolution.

Problem 2201a

Problem 2201a · CTU BE2M31DSPA exam

We have quasi-periodic signal with period ToT_\mathrm{o} which is less than number of the signal samples NN, i.e. To<NT_\mathrm{o} < N. How can be detected the periodicity of such signal using the autocorrelation function? (6 points)

We detect the side global maximum of ACF.

Problem 2202

Problem 2202 · CTU BE2M31DSPA exam

We have real signal x[n]x[n]. Explain symmetry of real part, imaginary part, magnitude, and phase of DFT spectrum X[k]X[k]. (6 points)

Real part: even, imag: odd, magnitude: even, phase: odd.

Problem 2203

Problem 2203 · CTU BE2M31DSPA exam

Signal x1[n]x_1[n] has discrete spectrum X1[k]X_1[k] and signal x2[n]x_2[n] has discrete spectrum X2[k]X_2[k]. Write formula for the computation of convolution of these two signals in the time domain. How is the convolution computed in the spectral domain? (6 points)

x1[n]∗x2[n]=∑k=−∞+∞x1[k] x2[n−k]x_1[n] * x_2[n] = \sum_{k=-\infty}^{+\infty} x_1[k]\,x_2[n-k]

Problem 2204

Problem 2204 · CTU BE2M31DSPA exam

What is spectral leackage in computation of DFT? How can we minimize this phenomenon? (6 points)

Spectral leakage is the phenomenon of smearing power across a frequency spectrum that occurs when the signal being analyzed is not periodic in the sample interval.

Example (of leakage): f=1000f = 1000 Hz, fs=8000f_\mathrm{s} = 8000 Hz (sinusoid).

A 1000 Hz sinusoid sampled at 8000 Hz: 8 and 9 samples, and their spectra

Left: when N=8N = 8 (one full cycle). Right: when N=9N = 9 (one full cycle AND one more point of the next cycle, which belongs to the next cycle): leakage occurred, power is smeared across the spectrum. Source: 2204.tex · Data: data.py

We minimize this phenomenon by using weighting windows which lower the discontinuity wherever we do not have full cycles of the signal. For speech signals, it is particularly useful because it can reveal hidden formants.

Problem 2205

Problem 2205 · CTU BE2M31DSPA exam

Why we are using weighting windows for computation of DFT? Draw a typical shape of the window which are usually used for such purpose. (6 points)

We are using weighting windows to minimize the phenomenon of spectral leakage.

Example of a weighting window: Hamming window.

The Hamming window

MM: number of samples of the function, as in Matlab. Source: 2205.tex · Data: data.py

Problem 2115

Problem 2115 · CTU BE2M31DSPA exam

Explain the principle of the sampling theorem. Determine, which minimal sampling frequency fsf_\mathrm{s} should be used for the sampling of the signal which has non-zero spectrum in the frequency band 0÷2000 \div 200 Hz. (6 points)

The sampling theorem specifies the minimum sampling rate at which a continuous-time signal needs to be uniformly sampled so that the original signal can be completely recovered or reconstructed by these samples alone.

If a function x(t)x(t) contains no frequencies higher than BB Hz, sufficient sampling rate is anything greater than 2B2B [samplessecond]\left[\frac{\text{samples}}{\text{second}}\right]. More succinctly, fs>2Bf_\mathrm{s} > 2B.

x(t)⇒0÷200x(t) \Rightarrow 0 \div 200 Hz. Highest frequency is 200 Hz.

So,fs>2⋅200 Hz,fs>400 Hz\text{So,}\quad f_\mathrm{s} > 2\cdot 200\ \text{Hz}, \qquad \boxed{f_\mathrm{s} > 400\ \text{Hz}}

Problem 2116

Problem 2116 · CTU BE2M31DSPA exam

Is it possible to decimate the signal sampled with fs=8000f_\mathrm{s} = 8000 Hz, which has the non-zero spectrum in the band 0÷20000 \div 2000 Hz? If so, what are the values of decimation factor and new sampling frequncy? If not, explain why. Draw illustrativelly the spectrum of the original and decimated signal. (6 points)

Yes, possible! Sampling theorem must be fulfilled:

fs,new>2×fmax,fmax=2000 Hzf_{s,\mathrm{new}} > 2\times f_\mathrm{max}, \qquad f_\mathrm{max} = 2000\ \text{Hz}

New sampling frequency fs,new=4000f_{s,\mathrm{new}} = 4000 Hz. MM = decimation factor:

M=fs,oldfs,new=8000 Hz4000 Hz=2=MBaseband Nyquist samplingM = \frac{f_{s,\mathrm{old}}}{f_{s,\mathrm{new}}} = \frac{8000\ \text{Hz}}{4000\ \text{Hz}} = \boxed{2 = M} \qquad \text{Baseband Nyquist sampling}
Spectrum of the original and the decimated signal

Top: original signal spectrum, fs,old=8000f_{s,\mathrm{old}} = 8000 Hz. Bottom: decimated signal spectrum, fs,new=4000f_{s,\mathrm{new}} = 4000 Hz. Source: 2116.tex

Problem 2117

Problem 2117 · CTU BE2M31DSPA exam

Is it possible to decimate the signal sampled with fs=8000f_\mathrm{s} = 8000 Hz, which has the non-zero spectrum in the band 1000÷40001000 \div 4000 Hz? If so, what are the values of decimation factor and new sampling frequncy? If not, explain why. Draw illustrativelly the spectrum of the original and decimated signal. (6 points)

Let’s see the calculations below. We must use band-pass sampling instead of Nyquist sampling (we used this in the previous problem).

Rules:

2fhM+1≤fs≤2fdM,\frac{2f_\mathrm{h}}{M+1} \le f_\mathrm{s} \le \frac{2f_\mathrm{d}}{M},

where

B (bandwidth)=fh−fd,M=floor(fdB)←band indexB\ (\text{bandwidth}) = f_\mathrm{h} - f_\mathrm{d}, \qquad M = \mathrm{floor}\left(\frac{f_\mathrm{d}}{B}\right) \leftarrow \text{band index}

fd=1000f_\mathrm{d} = 1000 Hz, fh=4000f_\mathrm{h} = 4000 Hz

B=fh−fd=4000−1000=3000 Hz,M=floor(10003000)=0B = f_\mathrm{h} - f_\mathrm{d} = 4000 - 1000 = 3000\ \text{Hz}, \qquad M = \mathrm{floor}\left(\frac{1000}{3000}\right) = 02fhM+1≤fs≤2fdM  ⇒  2⋅40001≤fs≤2⋅10000  ⇒  8000≤fs≤∞\frac{2f_\mathrm{h}}{M+1} \le f_\mathrm{s} \le \frac{2f_\mathrm{d}}{M} \;\Rightarrow\; \frac{2\cdot 4000}{1} \le f_\mathrm{s} \le \frac{2\cdot 1000}{0} \;\Rightarrow\; \boxed{8000 \le f_\mathrm{s} \le \infty}

Minimum fsf_\mathrm{s} is 8000, so we can’t downsample this signal!

Problem 2118

Problem 2118 · CTU BE2M31DSPA exam

Is it possible to decimate the signal sampled with fs=8000f_\mathrm{s} = 8000 Hz, which has the non-zero spectrum in the band 3000÷40003000 \div 4000 Hz? If so, what are the values of decimation factor and new sampling frequncy? If not, explain why. Draw illustrativelly the spectrum of the original and decimated signal. (6 points)

Same rules as above. The given signal is called a band-pass signal, so we must use band-pass sampling.

fd=3000 Hz,fh=4000 Hz,B=1000 Hz,M=floor(fdB)=3f_\mathrm{d} = 3000\ \text{Hz}, \quad f_\mathrm{h} = 4000\ \text{Hz}, \quad B = 1000\ \text{Hz}, \quad M = \mathrm{floor}\left(\frac{f_\mathrm{d}}{B}\right) = 32fhM+1≤fs≤2fdM  ⇒  2×40004≤fs≤2×30003\frac{2f_\mathrm{h}}{M+1} \le f_\mathrm{s} \le \frac{2f_\mathrm{d}}{M} \;\Rightarrow\; \frac{2\times 4000}{4} \le f_\mathrm{s} \le \frac{2\times 3000}{3}2000≤fs≤2000\boxed{2000 \le f_\mathrm{s} \le 2000}

→\rightarrow Yes! We can downsample this signal with fs=2000f_\mathrm{s} = 2000 Hz, decimation factor is 4.

I will use a continuous spectrum example for practical purposes.

Spectrum of the band-pass signal before and after decimation by 4

Top: original spectrum (which is sampled at Nyquist rate). Bottom: decimated spectrum, fs=2000f_\mathrm{s} = 2000 Hz. Source: 2118.tex

Problem 2119

Problem 2119 · CTU BE2M31DSPA exam

Explain the procedure for the realization of low-band signal reconstruction (interpolation) to target sampling frequency fs,new=8000f_\mathrm{s,new} = 8000 when it was decimated to sampling frequency fs=4000f_\mathrm{s} = 4000 Hz and when it had non-zero spectrum in the band 0÷20000 \div 2000 Hz before the decimation. (6 points)

Low-band interpolation: upsample by 2, low-pass, gain 2

fs,low=4f_{s,\mathrm{low}} = 4 kHz in, fs,high=8f_{s,\mathrm{high}} = 8 kHz out. Source: 2119.tex

Problem 2119a

Problem 2119a · CTU BE2M31DSPA exam

Explain the procedure for the realization of high-band signal reconstruction (interpolation) to target sampling frequency fs,new=8000f_\mathrm{s,new} = 8000 when it was decimated to sampling frequency fs=4000f_\mathrm{s} = 4000 Hz and when it had non-zero spectrum in the band 2000÷40002000 \div 4000 Hz before the decimation. (6 points)

High-band interpolation: upsample by 2, high-pass, gain 2

fs,low=4f_{s,\mathrm{low}} = 4 kHz in. Source: 2119a.tex

Problem 2121

Problem 2121 · CTU BE2M31DSPA exam

Describe the procedure of the change of the sampling frequency of the signal sampled with fs=8f_\mathrm{s} = 8 kHz to new sampling frequency fs,new=12f_\mathrm{s,new} = 12 kHz. (6 points)

fs=8f_\mathrm{s} = 8 kHz, fs,new=12f_{s,\mathrm{new}} = 12 kHz, LM=fs,newfs,orig\quad \dfrac{L}{M} = \dfrac{f_{s,\mathrm{new}}}{f_{s,\mathrm{orig}}}

Resampling 8 kHz to 12 kHz: up by 3, two low-pass filters, down by 2

fs=8f_\mathrm{s} = 8 kHz in, fs,new=12f_{s,\mathrm{new}} = 12 kHz out. Source: 2121.tex

Problem 2122

Problem 2122 · CTU BE2M31DSPA exam

Describe the procedure of the change of the sampling frequency of the signal sampled with fs=16f_\mathrm{s} = 16 kHz to new sampling frequency fs,new=6f_\mathrm{s,new} = 6 kHz. (6 points)

fs=16f_\mathrm{s} = 16 kHz, fs,new=6f_{s,\mathrm{new}} = 6 kHz, LM=616=38\quad \dfrac{L}{M} = \dfrac{6}{16} = \dfrac{3}{8}

Resampling 16 kHz to 6 kHz: up by 3, two low-pass filters, down by 8

fs=16f_\mathrm{s} = 16 kHz in, fs,new=6f_{s,\mathrm{new}} = 6 kHz out. Source: 2122.tex

Problem 2100

Problem 2100 · CTU BE2M31DSPA exam

What is spectrogram of the signal? Explain the term of time-frequency resolution in the signal spectrogram. Which parameter of spectrogram computation affects the time and the frequency resolution? (6 points)

A spectrogram is a visual representation of the spectrum of frequencies of a signal as it varies with time.

frequency resolution: Δf=fsN,time resolution: Δt=N\text{frequency resolution: } \Delta f = \frac{f_\mathrm{s}}{N}, \qquad \text{time resolution: } \Delta t = N

NN is the length of a short-time frame. Uncertainty principle: Δf⋅Δt=const\boxed{\Delta f\cdot\Delta t = \text{const}}

  • High NN →\rightarrow better freq. res.; worse time res.
  • Low NN →\rightarrow worse time res.; worse freq. res.

Problem 2100a

Problem 2100a · CTU BE2M31DSPA exam

Determine the procedure of signal spectrogram computation and show illustratively its typical graphical representation. Describe all axes! (6 points)

  1. Segmentation into short-time (s-t) frames.
  2. Weighting and possible overlap of s-t frames.
  3. DFT each periodogram.
  4. Observe as time varies.
A spectrogram: frequency in kHz over time in seconds

Frames of 0.5 s. Source: 2100a.tex

Problem 2101

Problem 2101 · CTU BE2M31DSPA exam

What is the difference between “power spectrum” and “power spectral density”? (6 points)

Power spectrum:

Gx[k]=∣X[k]∣2NG_x[k] = \frac{|X[k]|^2}{N}

Describes the distribution of power contained in a signal as a function of frequency. [watt]

PSD: PSD of the signal describes the power present in the signal as a function of frequency, per unit frequency. [watt/Hz]

pwelch can be used for PSD estimation.

Problem 2101a

Problem 2101a · CTU BE2M31DSPA exam

Explain the procedure of the computation of power spectral density (PSD) using the Welch method. (6 points)

  1. Signal is divided into short-time (s-t) frames (possibly with overlap).
  2. s-t frames can be weighted.
  3. Periodograms (power spectra) are computed for each s-t frame using DFT.
  4. Particular s-t periodograms are averaged.
The Welch method: overlapping weighted frames, a periodogram of each, averaged

Source: 2101a.tex

Problem 2102

Problem 2102 · CTU BE2M31DSPA exam

How can be detected the delay between two correlated signals x1[n]x_1[n] and x2[n]x_2[n] using cross-correlation function? Give the formula for the evaluation of cross-correlation function. (6 points)

Rxy[k]=Av[x[n] y[n+k]]R_{xy}[k] = \mathrm{Av}\left[x[n]\,y[n+k]\right]

Delay can be detected by localizing the global maximum of CCF (cross-correlation function).

Same as ACF, but two different signals are used.

Problem 2104

Problem 2104 · CTU BE2M31DSPA exam

What is the difference between deterministic and stachastic signal? Give the example of two deterministic signals and two stochastic signals. (6 points)

Deterministic: defined by generation formula (reproducible). Ex: harmonic signals, periodic signals, exponential pulse…

Stochastic: value is random and defined by probability density function (pdf). Ex: white noise, color noise…

Problem 2105

Problem 2105 · CTU BE2M31DSPA exam

Draw probality density function of signal samples for White Gaussian noise and for white noise with uniform distribution. (6 points)

Probability density functions: Gaussian and uniform

Uniform: same probability for values between aa and bb because it’s uniform! Source: 2105.tex

Problem 2106

Problem 2106 · CTU BE2M31DSPA exam

Draw illustratively power spectral density of White Gaussian noise. What is the relationship between the power spectral density nad variance of Gaussian white noise? (6 points)

Power spectral density of white Gaussian noise: flat, about 39 dB/Hz

Almost same power at all frequencies. Source: 2106.tex · Data: data.py

Describes how much power the random signal has given a frequency.

Variance is average power contained in the random signal.

© 2026 Giorgi Aptsiauri. All rights reserved. Do not copy or republish this text or its figures without permission. Online version: https://giorgiaptsiauri.com/notes/dsp-ctu/04-spectra-and-sampling/