You are on page 1of 6

Date: 04-06-2021 Reg.

# 2018-EE-430

University of Engineering & Technology Lahore


Experiment #8
Title: Multirate Signal Processing

Equipment Required: Personal Computer (PC) with Windows Operating System and
MATLAB Software

Task1:
Generate the following sequences:
𝑥1 [𝑛] = sin(2𝜋𝑓𝑛) , 𝑓 = 0.1 𝐻𝑧
𝑥2 [𝑛] = sin(2𝜋𝑓𝑛) , 𝑓 = 0.3 𝐻𝑧
𝑥[𝑛] = 𝑥1 [𝑛] + 𝑥2 [𝑛]
𝑦[𝑛] = 𝑥1 [𝑛] ∗ 𝑥2 [𝑛]
Read the helping topics:
 DOWNSAMPLE
Decrease sampling rate by integer factor. Syntax:
y=downsample(x,n)– Decreases the sampling rate of x by keeping every nth sample starting with the
first sample. x can be a vector or a matrix. If x is a matrix, each column is considered a separate sequence.
y=downsample(x,n,phase) – Specifies the number of samples by which to offset the downsampled
sequence. phase must be an integer from 0 to n – 1.
 UPSAMPLE
Increase sampling rate by integer factor. Syntax:
y=upsample(x,n)– Increases the sampling rate of x by inserting n – 1 zeros between samples. x can
be a vector or a matrix. If x is a matrix, each column is considered a separate sequence. The
upsampled y has x*n samples.
y=upsample(x,n,phase) – Specifies the number of samples by which to offset the upsampled
sequence. phase must be an integer from 0 to n – 1.
 INTERP
Increase sampling rate by integer factor. Syntax:
y=interp(x,r)– Increases the sampling rate of x, the input signal, by a factor of r. The interpolated
vector, y, is r times as long as the original input, x.
y=interp(x,r,n,alpha)– Specifies two additional values. n is half the number of original sample
values used to interpolate the expanded signal. Its default value is 4. It should ideally be less than or
equal to 10. alpha is the normalized cutoff frequency of the input signal, specified as a fraction of the
Nyquist frequency. It defaults to 0.5. The lowpass interpolation filter has length 2*n*r + 1.
[y,b]=interp(x,r,n,alpha)– Returns a vector, b, with the filter coefficients used for the
interpolation.
 DECIMATE
Decrease original sampling rate of a sequence to a lower rate. It is the opposite of interpolation. It
lowpass filters the input to guard against aliasing and downsamples the result.
Syntax:
y = decimate(x,r)– Reduces the sampling rate of x, the input signal, by a factor of r. The
decimated vector, y, is shortened by a factor of r so that length(y)=ceil(length(x)/r). By
default, it uses a lowpass Chebyshev Type I IIR filter of order 8.
y = decimate(x,r,n)– Uses a Chebyshev filter of order n. Orders above 13 are not recommended
because of numerical instability. The function displays a warning in those cases.
y = decimate(x,r,'fir')– Uses an FIR filter designed using the window method with a
Hamming window. The filter has order 30.
y = decimate(x,r,n,'fir')– Uses an FIR filter of order n.
 RESAMPLE
Resample uniform or non-uniform data to new fixed rate. Syntax and Description:
Questions

1. Perform the factor-of-4 down-sampling. Plot the original and down-sampled sequences.
2. Perform the factor-of-5 up-sampler. Plot the original and up-sampled sequences.
Task2:
Consider the system below:

Questions

1. Read the documentation of MATLAB's command firl. Design a lowpass FIR filter using the command.
2. Plot the frequency response of the lowpass FIR filter, 𝑦𝑢 [𝑛] and output sequence.
3. Implement an equivalent polyphase decomposition based decimation system for the system above in
MATLAB. How many additions and multiplications are required per unit time?
4. Do you see any gains in number of computations (i.e. without decimation and decimation)?
5. Modify the above system to get same output as an input.

You might also like