0% found this document useful (0 votes)
26 views

Labwork - 1 Sampling

The document describes an experiment on signal quantization. It generates a test signal, defines a quantization function, applies the function with 2 and 3 bits to quantize the signal, and plots the original and quantized signals. The test signal is a combination of two sinusoids, the quantization function maps a continuous signal to discrete values based on the number of bits, and the plots allow visual comparison of the original and quantized signals with different bit resolutions.

Uploaded by

Azad Karataş
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Labwork - 1 Sampling

The document describes an experiment on signal quantization. It generates a test signal, defines a quantization function, applies the function with 2 and 3 bits to quantize the signal, and plots the original and quantized signals. The test signal is a combination of two sinusoids, the quantization function maps a continuous signal to discrete values based on the number of bits, and the plots allow visual comparison of the original and quantized signals with different bit resolutions.

Uploaded by

Azad Karataş
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

21.10.

2015

Exp2

Contents
Partasignalgeneration
PartbQuantizationFunction
PartcQuantization
PartdPlotting

clearall
closeall
clc

Partasignalgeneration
f1=500;
f2=1500;
Fs=12000;
dur=0.01;
t=0:1/Fs:dur1/Fs;
x=0.8*cos(2*pi*f1*t)+1.9*sin(2*pi*f2*t);

PartbQuantizationFunction
functionxq=quantize2(x,a,b,N)
xq=floor(((xa)/(ba))*(2^N1))*((ba)/(2^N1))+a

PartcQuantization
a=min(x);
b=max(x);
N1=2;
N2=3;
xq1=quantize2(x,a,b,N1);
xq2=quantize2(x,a,b,N2);

PartdPlotting
figure;
subplot(211);
plot(t,x,'b',t,xq1,'r');
title('Quantizationwith2bits')
subplot(212);
plot(t,x,'b',t,xq2,'r');
title('Quantizationwith3bits')

file:///C:/Users/oktay/Dropbox/OKTAY/___RA_Lessons_15_16_1/Comm%202/LabPrelabQuizes/html/Exp2.html

1/2

21.10.2015

Exp2

PublishedwithMATLABR2014a

file:///C:/Users/oktay/Dropbox/OKTAY/___RA_Lessons_15_16_1/Comm%202/LabPrelabQuizes/html/Exp2.html

2/2

You might also like