BE2M31DSPA Exercise - Discrete Fourier Transform (DFT)
Basic properties of periodogram and application examples
Tasks to do:
-
DFT - periodogram, spectral leackage
- Generate sinosoid with parameters f=1000 Hz, fs=8000 Hz, to=0.1 s (duration).
- Choose the short-time frame with the length of N=512
samples and compute its periodogram using DFT (fcn fft).
Describe correctly scale on frequency axis in Hertz and observe
various way of results displaing (i.e. use fcn plot
with varoius parameters or fcn stem).
- Observe also the periodogram for frame length of N=512, 510,
508 samples and N=512, 515, 520 samples. Explain
observed results for varying frame length.
- Repeat poit above for sinosoid with parameters f=1231 Hz,
fs=8000 Hz, to=0.1 s (duration) for frame length of
N=512, 510, 508 samples. Explain a difference in comparison
to the previous case of the sinusoid with f=1000 Hz.
- Repeat the same analyses when Hamming window is used for
short-time frame weighting (fcn hamming).
-
Weighting in a detection of harmonic components in the signal of software-defined broadcast (radio)
- Checked result:
Load signal x_spl.mat which contains a mixture of harmonic components in a record with the length N = 250 samples. Signal is
sampled by frequency fs = 1 kHz and it is saved in MATLAB
format. For loading it into the MATLAB environment use function load. For given signal observe:
- power spectrum (periodogram) of signal with given length N = 250 without weighting
both in linear and logarithmic scale (in dBs),
- power spectrum of signal weighted by Hamming window in linear and logarithmic scale (in dBs),
- power spectrum of signal weighted by Blackman window in linear and logarithmic scale (in dBs).
- Observe short-time DFT spectrum of speech signal.
- Checked result:
Read the part of voiced speech sound vm7.bin, which is sampled
by fs = 16 kHz and saved in raw binary form without a header. To load it into MATLAB
environment use attached function loadbin.m,
this function is not part of any standard MATLAB toolbox! You should place it into your
working directory! Realize the following analyses for given signal:
- draw short-time power spectrum in dB for the first available
frame with the length of N=512 samples,
- compare the spectrum for weighted (Hamming window) and
unweighted (rectangular window) short-time frame,
- determine the frequency of the first main peak in spectral envelope,
- compare power spectra computed for the frame lengths of N=64,
128, 256, 512, 1024, 2000 samples.
- In the case of free time, repeat illustratively also for
signals: vf0.bin, vm0.bin,
vf1.bin, vm1.bin,
vf2.bin, vm2.bin,
vf3.bin, vm3.bin,
vf4.bin, vm4.bin,
vf5.bin, vm5.bin,
vf6.bin, vm6.bin,
vf7.bin, vm7.bin,
vf8.bin, vm8.bin,
vf9.bin, vm9.bin.
- Zero padding in computation of DFT
- Generate the sinusoid with f = 1231 Hz,
fs = 8000 Hz nad the frame length of N=512 samples. Observe
periodogram computed by DFT with the order of NDFT = 512, 1024,
2048, 4096, 8192 and explain obtained results.
-
Accuracy improvement for the analysis of harmonic components in a
record.
- Checked result :
Load signals sig1.mat and
sig2.mat containing the short records
of a mixture of harmonic components with background gaussian white noise. The
signals are sampled by fs = 200 Hz and they are saved in
MATLAB binary format. Use the fcn load to load the data into
MATLAB.
Determine for both signals:
- number of harmonic components and their frequencies,
- do it on the basis of DFT spectrum computed from available length
of N=40 samples or from the record extended by zeros to the
length of N=512 samples.
-
Interpolation (zero-padding) in a detection of harmonic components in the signal of software-defined broadcast (radio)
- Checked result:
For previously analyzed signal x_spl.mat observe also:
- interpolated magnitude spectrum of signal without
weigthing in linear and logarithmic scale, which is computed using DFT of the order N = 2048 (padded by zeros),
- interpolated magnitude spectrum of signal weighted by Hamming window in linear and logarithmic scale (computed using DFT of the order N = 2048, padded zeros),
- interpolated magnitude spectrum of signal weighted by Blackman window in linear and logarithmic scale (computed using DFT of the order N = 2048, padded zeros).
- Periodicity in Short-Time DFT Spectrum
- Observe periodograms of following signals which contain one,
two, three, or four periods of voiced speech sound vm0-1-per.bin, vm0-2-per.bin, vm0-3-per.bin, vm0-4-per.bin. The signals have
binary format, to load them into MATLAB
use the function loadbin.m.
and find shor-time DFT of these signal. Length of the DFT should be
always the same as length of analyzed signal.
- Observe the changes in the spectrum of the signal vm0-4-per.bin (with 4 periods) when
it is analyzed by DFT of the order
a) 479, 481
b) 470, 490
c) 256, 512
d) 1024
e) 2048
- Checked result:
Observe the priodicity in the real signal (part of voiced phone) vm0-real-per.bin and try to estimate
fundamental period (and fundamental frequency) of given
quasiperiodic signal (voiced speech sound). Compute the periodogram for
a) NFFT = 512
b) NFFT = 4096
- Checked result:
Observe the spectrum on aperiodic signal (part of unvoiced phone) real-non-per.bin and compare with previous variant of periodic signal. Compute the periodograms
again for
a) NFFT = 512
b) NFFT = 4096
IN THE CASE OF FREE TIME
- Determine the voice pitch also for other records referenced in the
first item of this exercise.
- Determine the pitch of musical instrument tones from last week
exercises and compare it with the results achieved using
autocorrelation analysis -
cembalo_d_dur_2.wav, fletna_d_dur_6.wav, housle_d_dur_5.wav, kytara_d_dur_1.wav, piano_d_dur_4.wav, varhany1_d_dur_3.wav, varhany2_d_dur_8.wav.