0% found this document useful (0 votes)
8 views7 pages

Signal Processing: Decimation & Interpolation

1) The original COS wave contains 5 frequencies between 2-10 kHz sampled at 10 kHz. 2) The FFT plot shows 5 distinct peaks at the 5 frequencies. 3) After decimation by 3, some frequencies are aliased together due to insufficient sampling. 4) When the decimated signal is interpolated back by 4, it reconstructs the original signal shape but with some loss of information.

Uploaded by

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

Signal Processing: Decimation & Interpolation

1) The original COS wave contains 5 frequencies between 2-10 kHz sampled at 10 kHz. 2) The FFT plot shows 5 distinct peaks at the 5 frequencies. 3) After decimation by 3, some frequencies are aliased together due to insufficient sampling. 4) When the decimated signal is interpolated back by 4, it reconstructs the original signal shape but with some loss of information.

Uploaded by

marryam nawaz
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DSP

LAB REPORT # 6

Sampling and multi-rate signal processing:


decimation and interpolation

Submitted By:

Marryam Nawaz
SP-12-BET-043

Hifza Sajid
SP-12-BET-029

Submitted To:
Sir Mobeen Sabir

Class Instructor:
Sumayya Haroon

Class:
BET-5A
Dated:
21/03/2014
Use your ‘sinegen’ function to generate a sine wave with f = 3kHz and fs = 8kHz.
Calculate its fft with zero frequency component in the middle. Plot it on a
properly scaled w-axis.

CODE:

t=-5:0.01:5;
y=sin(2*pi*30*t);
Y=fft(y,80);
subplot(2,1,1)
plot(y),grid on
title('Sine Wave')
subplot(2,1,2)
plot(Y),grid on
title('FFT')

GRAPH:

Sine Wave
1

0.5

-0.5

-1
0 200 400 600 800 1000 1200

FFT
40

20

-20

-40
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
-12
x 10
Sine Wave
1

-1
0 200 400 600 800 1000 1200
FFT
50

-50
-1 -0.5 0 0.5 1 1.5 2 2.5 3 3.5 4
-12
x 10
Downsampler Signal
20

-20
-1 -0.5 0 0.5 1 1.5
-12
x 10

Decimate the signal in task 1 with ‘M = 2’ and plot the resultant signal. Give your
observations about the plots in your reports

CODE:

t=-5:0.01:5;
y=sin(2*pi*30*t);
Y=fft(y,80);
subplot(3,1,1)
plot(y),grid on
title('Sine Wave')
subplot(3,1,2)
plot(Y),grid on
title('FFT')
subplot(3,1,3)
z=decimate(Y,2);
plot(z),grid on
title('Downsampler Signal')

GRAPH:
Repeat task 2 for following signals:
 x1[n] = cos(2*pi*f0/fs*n)+cos(2*pi*f1/fs*n)
o f0 = 2kHz; f1 = 6kHz; fs = 10kHz;
 x2[n] = cos(2*pi*f0/fs*n)+cos(2*pi*f1/fs*n)+ cos(2*pi*f1/fs*n)
o f0 = 2kHz; f1 = 4kHz; f2 = 3kHz; fs = 10kHz;

CODE:

n=-5:5;
f0 = 2; f1 = 6; fs = 10;
y= cos(2*pi*f0/fs*n)+cos(2*pi*f1/fs*n);
Y=fft(y,80);
subplot(3,1,1)
plot(y),grid on
title('Sine Wave')
subplot(3,1,2)
plot(Y),grid on
title('FFT')
subplot(3,1,3)
z=decimate(Y,2);
plot(z),grid on
title('Downsampler Signal')

GRAPH:
Sine Wave
2

-1
1 2 3 4 5 6 7 8 9 10 11
FFT
5

-5
-1 0 1 2 3 4 5 6 7
Downsampler Signal
5

-5
-1 0 1 2 3 4 5 6 7

CODE:

n=-5:5;
f0 = 2; f1 = 4;f2=3;fs = 10;
y= cos(2*pi*f0/fs*n)+cos(2*pi*f1/fs*n)+ cos(2*pi*f1/fs*n)
Y=fft(y,80);
subplot(3,1,1)
plot(y),grid on
title('Sine Wave')
subplot(3,1,2)
plot(Y),grid on
title('FFT')
subplot(3,1,3)
z=decimate(Y,2);
plot(z),grid on
title('Downsampler Signal')

GRAPH:

Sine Wave
4

-2
1 2 3 4 5 6 7 8 9 10 11
FFT
10

-10
-6 -4 -2 0 2 4 6
Downsampler Signal
10

-10
-4 -3 -2 -1 0 1 2 3 4 5 6
Explain which components will be aliased & why?

For 1stsignal :

Fmax=6KHZ &Fs=10KHz
As Fs !> 2Fmax
So it contain aliasing.

For 2nd signal :

Fmax=4KHZ &Fs=10KHz
As Fs> 2Fmax
So it does contain aliasing.

Assignment Task

CODE:

t=-5:0.14:5;
f0 = 2; f1 = 4;f2=6;f3=8;f4=10;fs = 10;
y= cos(2*pi*f0/fs*t)+cos(2*pi*f1/fs*t)+ cos(2*pi*f2/fs*t)+ cos(2*pi*f3/fs*t)+ cos(2*pi*f4/fs*t)
Y=fft(y,80);
subplot(4,1,1)
plot(y),grid on
title('COS Wave')
subplot(4,1,2)
plot(Y),grid on
title('FFT')
subplot(4,1,3)
z=decimate(Y,3);
plot(z),grid on
title('Downsampler Signal')
subplot(4,1,4)
Z=interp(z,4);
plot(Z),grid on
title('Upsempler Signal')

GRAPH:
COS Wave
5

-5
0 10 20 30 FFT
40 50 60 70 80
50

-50
-20 -10 0 Downsampler
10 Signal 20 30 40
20

-20
-5 0 5 10 15 20
Upsempler Signal
20

-20
-5 0 5 10 15 20

Common questions

Powered by AI

Multirate signal processing modifies the sampling rate, thereby altering signal bandwidth and resolution. Decimation reduces the sample rate, potentially causing aliasing if not properly filtered and narrowing the bandwidth, which compresses the frequency resolution . Interpolation, on the other hand, increases the sample rate, expanding the bandwidth and improving frequency resolution by adding interpolated samples between original data points . Both processes are crucial in accommodating different system constraints and requirements in signal processing.

Interpolation increases a signal's sample rate by estimating new data points between existing samples, enhancing signal resolution and bandwidth but without necessarily increasing original detail. It is useful for preparing signals for further processing or adapting to different sampling requirements. Decimation reduces the sample rate, saving data space but possibly at the cost of losing high-frequency information unless proper filtering is applied to maintain fidelity. Both processes serve distinct applications: interpolation is often used in upsampling for quality improvement, while decimation is mainly used for data reduction and efficient storage .

Downsampling compresses the FFT spectrum by reducing the number of data points, which can lead to loss of frequency detail and potential aliasing if not pre-filtered. To maintain signal integrity, it's essential to apply an anti-aliasing filter before downsampling to eliminate components above the new Nyquist frequency. Properly filtered downsampling preserves essential frequency components, ensuring the FFT representation remains an accurate reflection of the original signal within the new bandwidth limitations .

Different decimation ratios significantly affect signal representation and FFT output by altering the effective sampling rate. Higher decimation ratios reduce the sample count more drastically, leading to higher chances of aliasing and distortion unless adequately filtered. They compress the FFT into a narrower range, potentially losing details in high-frequency components. The accuracy of signal representation decreases with higher decimation rates because it discards more signal content, so choosing an appropriate ratio is crucial to balance between reducing data and preserving fidelity .

To avoid aliasing during decimation, the Nyquist criterion must be satisfied. This involves ensuring that the original signal is band-limited before sampling, meaning it contains no frequency components above half the sampling rate. In practice, a low-pass filter is applied before decimation to remove such high-frequency components, thereby preventing aliasing. This is reflected in the source, where decimation without appropriate filtering would result in frequency distortion and aliasing in the downsampled signal .

When performing FFT on a cosine wave composed of multiple frequencies, the resulting spectrum displays peaks at each frequency component. This contrasts with a single frequency cosine wave, which only shows a single peak. In a multi-frequency composition, the FFT provides a detailed spectral view showing each of the individual components, which can reveal interactions between frequencies, such as beat frequencies or modulation effects, that are not present in single frequency signals. The source illustrates this with signals having multiple frequency components, confirming the distinct spectral lines .

Interpolating a decimated signal can aid in approximating the original sample rate, effectively filling in gaps with estimated data points and thus smoothing out the signal. This aids in recovering continuity and can restore some representation of the original signal's shape. However, interpolation cannot restore any informational content lost during the decimation process, such as high-frequency details beyond its modified bandwidth. The limitation is that while interpolating improves signal resolution, it cannot regenerate components lost below the cutoff frequency .

Zero frequency components, or the DC component, represent the average value of the signal over time. In an FFT plot, they appear at the center if the zero frequency component is placed in the middle of the spectrum. This helps in analyzing periodic signals by distinguishing the fundamental frequency and the harmonics from the average value . Placing the zero frequency in the middle separates positive and negative frequency components, aiding in clearer analysis.

Decimation reduces the sampling rate of a signal, which in turn compresses the FFT spectrum into a smaller frequency range when plotted. This operation can cause aliasing if the original sampling rate wasn't sufficient to meet the Nyquist criterion. In the plot, the downsampled FFT appears more compact and potentially distorted if aliasing occurs, as observed in the decimated plots showing altered frequency components .

Aliasing occurs when the sampling frequency is less than twice the maximum frequency component of the signal. In the first signal where f0=2kHz and f1=6kHz, the maximum frequency (Fmax) is 6kHz, and since the sampling frequency (Fs) is 10kHz, which is less than 2*Fmax (12kHz), aliasing occurs . In the second signal with f0=2kHz, f1=4kHz, f2=3kHz, the maximum frequency is 4kHz, and Fs=10kHz, which is greater than 2*Fmax (8kHz), so there is no aliasing .

You might also like