code:goftergui

This shows you the differences between two versions of the page.

— |
code:goftergui [2015/11/19 14:59] (current) michfiel created |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | |||

+ | === Pulses === | ||

+ | |||

+ | [[http://en.wikipedia.org/wiki/Pulse_wave]] | ||

+ | |||

+ | A pulse wave form can simple be constructed by adding two saw waves; the phase difference will control the pulse width. | ||

+ | |||

+ | <code> | ||

+ | double pw = pulseWidth / 2. + 1.; | ||

+ | double y1 = ((int)(f * i) % n) / n1; | ||

+ | double y2 = ((int)(f * i + pw) % n) / n1; | ||

+ | double y = (y1 - y2) * (1 + pulseWidth / n1); | ||

+ | </code> | ||

+ | |||

+ | === Comb Filters === | ||

+ | |||

+ | [[http://en.wikipedia.org/wiki/Comb_filter]] | ||

+ | |||

+ | The frequency response of a discrete-time system expressed in the Z domain is obtained by making the substitution z=exp(j*omega) | ||

+ | |||

+ | <code> | ||

+ | double omega = 2 * pi * f/n; | ||

+ | double y = sqrt((1. + pow(alpha, 2.)) + 2 * alpha * cos(omega * K)) / 2; | ||

+ | </code> | ||

code/goftergui.txt ยท Last modified: 2015/11/19 14:59 by michfiel