File:Quanterr.png

From formulasearchengine
Jump to navigation Jump to search

Quanterr.png(489 × 320 pixels, file size: 2 KB, MIME type: image/png)

This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

Summary

Description Plot of a quantized signal and its error
Date
Source Own work
Author Atropos235

Source Code

close all; figure
t = 0:0.0001:2;
   % generate some nice looking signal then scale to +/- 1
x = 2*cos(2*pi*t)+1.5*cos(4*pi*t+2)+1*cos(5*pi*t)+0.5*cos(10*pi*t);
x = 2*(x - min(x))/(max(x)-min(x)) - 1;
   % quantization
n = 2; % bits 
xq = floor((1-1e-12)*(x+1).*2.^(n-1));
xq = xq / (2^(n-1));
xq = xq - (2^n - 1) / 2^n;
   % error signal
qerr = x - xq;
   % plot
subplot(211); plot(t,x,'b',t,xq,'r'); title('Original and Quantized Signal');
subplot(212); plot(t,qerr,'b'); title('Quantization Error');

Licensing

Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

Captions

Plot of a quantized signal and its error

Items portrayed in this file

depicts

23 February 2008

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current23:13, 6 May 2010Thumbnail for version as of 23:13, 6 May 2010489 × 320 (2 KB)wikimediacommons>Aiyizolosslessly compressed with pngout

There are no pages that use this file.