File:Pulse density modulation.svg

From Wikimedia Commons, the free media repository

Jump to: navigation, search

Pulse_density_modulation.svg(SVG file, nominally 720 × 540 pixels, file size: 41 KB)

[edit] Summary

Description
Date

2007-10-23 (original upload date)

Source

Transfered from en.wikipedia Transfer was stated to be made by User:moxfyre.

Author

Original uploader was Moxfyre at en.wikipedia

Permission
(Reusing this image)

CC-BY-SA-3.0,2.5,2.0,1.0; Released under the GNU Free Documentation License.

[edit] Program code

Here is the Python code to produce this graph, using NumPy and Matplotlib. Includes my implementation of the algorithm derived in pulse-density modulation:

#!/usr/bin/python2.5
from pylab import *
from numpy import *
 
def pdm(x):
    y = zeros_like(x)
    qe = zeros_like(x)
 
    qe[-1] = 0 # inital [[:en:quantization error]] is 0
    for n in range(x.size):
        y[n] = 2*( x[n] > qe[n-1] ) - 1
        qe[n] = y[n] - x[n] + qe[n-1]
 
    return y, qe
 
def squarify(x, y):
    halfway = ( x[1:]+x[:-1] )/2
    xo = hstack(( x[0], repeat(halfway, 2), x[-1] ))
    yo = repeat(y, 2)
    return xo, yo
 
t = arange(100.0)
x = sin(2*pi/100 * t)
y, qe = pdm(x)
 
to, yo = squarify(t, y)
plot( label="PDM sine wave", *squarify(t,y) )
plot( t, x, label="PCM sine wave", linewidth=5 )
 
axis((-5, 105, -1.25, 1.5))
legend(loc='upper right')
 
xticks(fontsize=16)
yticks(fontsize=16)
xlabel("Discrete time (n)", fontsize=18)
ylabel("Signal amplitude",fontsize=18)
 
savefig("pdm.svg", transparent=True)

[edit] Licensing

Moxfyre at en.wikipedia, the copyright holder of this work, has published or hereby publishes it under the following licenses:
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Afrikaans | Alemannisch | Aragonés | العربية | Asturianu | Беларуская | Беларуская (тарашкевіца) | Български | বাংলা | ইমার ঠার/বিষ্ণুপ্রিয়া মণিপুরী | Brezhoneg | Bosanski | Català | Cebuano | Česky | Dansk | Deutsch | Ελληνικά | English | Esperanto | Español | Eesti | Euskara | فارسی | Suomi | Français | Gaeilge | Galego | עברית | Hrvatski | Magyar | Հայերեն | Bahasa Indonesia | Ido | Íslenska | Italiano | 日本語 | ქართული | ភាសាខ្មែរ | 한국어 | Kurdî / كوردی | Latina | Lëtzebuergesch | Lietuvių | 文言 | Македонски | Bahasa Melayu | Malti | Nnapulitano | Plattdüütsch | Nederlands | ‪Norsk (nynorsk)‬ | ‪Norsk (bokmål)‬ | Occitan | Polski | Português | Română | Русский | Slovenčina | Slovenščina | Shqip | Српски / Srpski | Svenska | Kiswahili | తెలుగు | ไทย | Tagalog | Türkçe | Українська | اردو | Vèneto | Tiếng Việt | Volapük | Yorùbá | 中文 | ‪中文(简体)‬ | ‪中文(繁體)‬ | +/−

Creative Commons license
Creative Commons Attribution iconCreative Commons Share Alike icon
This file is licensed under the Creative Commons Attribution ShareAlike 3.0, Attribution ShareAlike 2.5, Attribution ShareAlike 2.0 and Attribution ShareAlike 1.0 License. In short: you are free to share and make derivative works of the file under the conditions that you appropriately attribute it, and that you distribute it only under a license identical to this one. Official license.

Afrikaans | Беларуская | Български | Català | Česky | Dansk | Deutsch | Ελληνικά | English | Esperanto | Español | Eesti | Euskara | Estremeñu | Suomi | Français | עברית | Hrvatski | Հայերեն | Italiano | 日本語 | 한국어 | Lietuvių | Македонски | Plattdüütsch | Nederlands | ‪Norsk (bokmål)‬ | Occitan | Polski | Piemontèis | Português | Română | Русский | Slovenčina | ไทย | Vèneto | Tiếng Việt | 中文 | ‪中文(简体)‬ | ‪中文(繁體)‬ | +/−

You may select the license of your choice.

[edit] Original upload log

The original description page is/was here. All following user names refer to en.wikipedia.

  • 2007-10-23 06:56 Moxfyre 607×494×0 (33019 bytes) Self-made using algorithm derived in [[pulse-density modulation]]

File history

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

Date/TimeThumbnailDimensionsUserComment
current06:07, 22 April 2009Thumbnail for version as of 06:07, 22 April 2009720×540 (41 KB)Moxfyre (Talk | contribs) (Previous version cut off y-axis captions, whoops!)
18:53, 21 April 2009Thumbnail for version as of 18:53, 21 April 2009720×540 (19 KB)Moxfyre (Talk | contribs) (made it coarser and square-waved, so the PDM is easier to visualize)
01:38, 17 December 2007Thumbnail for version as of 01:38, 17 December 2007607×494 (32 KB)Moxfyre (Talk | contribs) ({{Information |Description={{en|Self-made using en:Python (programming language), en:NumPy and en:Matplotlib. Here's my implementation of the algorithm derived in en:pulse-density modulation: <source lang="python"> from pylab import )

There are no pages that link to this file.

Global file usage

The following other wikis use this file: