Image:Quanterr.png

From Wikipedia, the free encyclopedia

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

[edit] Summary

Description

Plot of a quantized signal and it's error

Source

self-made

Date

23 February 2008

Author

Atropos235

Permission
(Reusing this image)

see below


[edit] 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');

[edit] Licensing

Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.


Afrikaans | Alemannisch | Aragonés | العربية | Asturianu | Български | Català | Česky | Cymraeg | Dansk | Deutsch | Eʋegbe | Ελληνικά | English | Español | Esperanto | Euskara | Estremeñu | فارسی | Français | Galego | 한국어 | हिन्दी | Hrvatski | Ido | Bahasa Indonesia | Íslenska | Italiano | עברית | Kurdî / كوردی | Latina | Lietuvių | Latviešu | Magyar | Македонски | Bahasa Melayu | Nederlands | ‪Norsk (bokmål)‬ | ‪Norsk (nynorsk)‬ | 日本語 | Polski | Português | Ripoarisch | Română | Русский | Shqip | Slovenčina | Slovenščina | Српски / Srpski | Svenska | ไทย | Tagalog | Türkçe | Українська | Tiếng Việt | Walon | ‪中文(简体)‬ | ‪中文(繁體)‬ | zh-yue-hant | +/-

File history

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

Date/TimeDimensionsUserComment
current03:41, 24 February 2008489×320 (5 KB)Atropos235 ({{Information |Description=Plot of a quantized signal and it's error |Source=self-made |Date=23 February 2008 |Author= Atropos235 |Permission= |other_versions= }} ==Source Code== <pre><nowiki> close all; figure t = 0:0.0001:2; % gen)
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):