Digital Signal Processing 1 Lab course Winter Term Assignment 2

Digital Signal Processing 1

Lab course Winter Term

Assignment 2

1. Timedomain–Frequencydomain

1 0.8 0.6 0.4 0.2 0

-2

1 0.8 0.6 0.4 0.2 0

-2

0

2 4

6

8 10

12

1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0

1

0.8

0.6

0.4

0.2

0

▪ ▪

▪ ▪

▪ ▪

Which fundamental relationship exists between the two domains? Take a look at figure 1 and try to explain the illustrations.

▪ Red dashed line: Range of sampled values

▪ Blue lines: Signal
Draw a basic discrete frequency domain scheme of figure 1 within the range [-3Fs 3Fs].

▪ Fs… Sampling frequency
Why does the discrete frequency domain scheme look like this? What causes the effect? The second row shows the filtered signal within the frequency domain using and ideal low pass filter.
Why is the complete second half of the spectrum not weighted with zeros for the filter operation? (See red dashed line)
Which cut-off frequency was used?
Why does the matching time domain look distorted? Which effects are causing this distortion?

0

2 4

6

8 10

12

Time domain – Discrete sampling over limited time space

Frequency domain – Two-sided amplitude spectrum

0 10 20 30 40 50 60 70 80 90 100

Frequency [Hz]

Frequency domain – Ideal low pass filter

0 10 20 30 40 50 60 70 80 90 100

Frequency [Hz]

y(t) y(t)

|Y(f)| |Y(f)|

t [s]

Time domain – Filtered signal

t [s]

Figure 1: Impulse in time and frequency domain (1st row). Filtered impulse signal in frequency and time domain (2nd row).

Applied Image & Signal Processing
Informationstechnik & System-Management 1/ 3 Salzburg University of Applied Sciences

Digital Signal Processing 1

Lab course Winter Term

2. DiscreteConvolution

▪ What is the convolution function?
▪ Write down the formula of the discrete one dimensional convolution. ▪ Implement a one dimensional convolution function in MATLAB.

▪ Functionsignature[w]=myconv(u,v)
▪ Write a MATLAB test script testconv.m which compares your implementation

with the MATLAB reference implementation conv in a 1×2 plot.

(1st plot: reference conv; 2nd plot: myconv) ▪ What is the fast discrete convolution?

▪ Illustrate the basic concept. State the benefits and drawbacks of the fast discrete convolution.

▪ Implement your own fast discrete convolution function in MATLAB. ▪ Functionsignature[w]=myfastconv(u,v)

▪ Extend your test script testconv.m by adding a third row, plotting the result of your implementation myfastconv.

3. DiscreteCrossCorrelation

▪ Revise the fundamental mathematics towards the discrete cross correlation.

  • ▪  Which analogies can be seen towards the discrete convolution?
  • ▪  Create a MATLAB test script which uses the functions myconv and

    myfastconv from section 2 to serve as cross correlation functions. Again use a 1×3 plot to compare to the reference MATLAB function xcorr.

    4. Applications

    Discrete convolution and cross correlation can be used in a variety of applications. The following two applications should give a brief example, what purposes can be fulfilled.

a. Convolution: Reverb effect

▪ Create a MATLAB program which allows mixing real space models with an arbitrary audio signal.

▪ Use your own MATLAB function you implemented in section 2. b. Correlation: Audio delay estimation

  • ▪  Extract the left and right channel of a given audio sample and determine the delay between the channels by using cross correlation.
  • ▪  Determine the distance between the microphone channels.

    Applied Image & Signal Processing Informationstechnik & System-Management Salzburg University of Applied Sciences

2/ 3

Digital Signal Processing 1

Lab course Winter Term

Home Assignment: Discrete Autocorrelation

▪ Create a MATLAB demo script demoautocorr.m which generates the variable Fourier series for a square wave signal and a uniformly distributed noise signal.

▪ Fourier series – 1 sec period
4h 𝑛 1

▪ 𝑓(𝑥) = 𝜋 ∑
▪ Be careful: step size is 2 for sum

𝑘=1,3,5,…

𝑘 sin(2𝜋𝑘𝑥)

▪ Common parameters for both signals
▪ Sampling frequency; [1 1000]Hz; default: 1kHz
▪ Signal length (Number of periods); [1 10]sec; default: 1 sec.

▪ Fourier series specific parameters
▪ Amplitude (h); [0 10]; default: 1 ▪ Fourier series length (k); [1 21]

▪ Noise signal specific parameters
▪ Amplitude (h); [0 10]; default: 1

▪ Design a MATLAB GUI within the test script. Requirements:
▪ 2×1 plots for generated signal and ACF.
▪ Parameters variation in the defined range (sliders).
▪ Option to select ACF function from section 3 (radio button). ▪ Plots should be updated automatically on parameter change.

  • ▪  Analyze the ACF spectrum for different parameter settings.
    ▪ Name the influences of the single parameters on the ACF.
    ▪ Write a technical paper stating your results with the following limitations:

    ▪ One single A4 page two column style (IEEE manuscript style1) ▪ PDF document
    ▪ Maximum of four figures (comprehensively explained in text)

  • ▪  MATLAB M files must have a header. Plots should be labeled and must have axis labeling.
  • ▪  Required upload

▪ demoautocorr.m ▪ autocorr.pdf

1 http://www.ieee.org/conferences_events/conferences/publishing/templates.html

Applied Image & Signal Processing Informationstechnik & System-Management Salzburg University of Applied Sciences

3/ 3