X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/043c676f59520b93dfacfa0d8d7e1fdd448cd7dc..1878a8448a5a73cbf289306beb5e88ab48561129:/dsp_files/complex.dsp?ds=inline diff --git a/dsp_files/complex.dsp b/dsp_files/complex.dsp deleted file mode 100644 index a5b6fa9..0000000 --- a/dsp_files/complex.dsp +++ /dev/null @@ -1,42 +0,0 @@ -PI = 3.1415926535897932385; -square = _ <: *; - -// Complex in cartesian coordinates -carte_cplx = _, _: (_, 1 : vectorize), (_, 1 : vectorize) : #; - -// Cartesian complex : basic operations -ccplx_real = _, 0 : []; -ccplx_imag = _, 1 : []; -ccplx_conj = _ <: ccplx_real, ccplx_imag : _, (0, _ : -) : carte_cplx; -ccplx_modul2 = _ <: ccplx_real, ccplx_imag : square, square : +; -ccplx_modul = ccplx_modul2 : sqrt; -ccplx_angle = _ <: (ccplx_imag, ccplx_real : / : atan), (ccplx_real, 0 : < : _, PI : *) : +; -ccplx_div_real = _, _ <: ccplx_real, _, ccplx_imag, _ : /, / : carte_cplx; - -// cartesian complex : add, sub, mul and div -ccplx_add = +; -ccplx_sub = -; - -ccplx_mul = _, _ <: ccplx_real, ccplx_real, ccplx_imag, ccplx_imag,ccplx_real, ccplx_imag, ccplx_imag, ccplx_real : *, *, *, * : -, + : carte_cplx; - -ccplx_div = _, _ <: ccplx_real, ccplx_real, ccplx_imag, ccplx_imag, ccplx_imag, ccplx_real, ccplx_real, ccplx_imag, !, ccplx_real, !, ccplx_imag : *, *, *, *, square, square : +, -, + : carte_cplx, _ : ccplx_div_real; -//ccplx_div = _, _ <: _, ccplx_conj, !, _ : ccplx_mul, ccplx_modul2 : ccplx_div_real; - -// Complex in polar coordinates -polar_cplx = _, _: (_, 1 : vectorize), (_, 1 : vectorize) : #; -pcplx_modul = _, 0 : []; -pcplx_angle = _, 1 : []; -pcplx_real = _ <: pcplx_modul, (pcplx_angle : cos) : *; -pcplx_imag = _ <: pcplx_modul, (pcplx_angle : sin) : *; - -// conversion between cartesian complex and polar complex -polar2carte = _ <: pcplx_real, pcplx_imag : carte_cplx; -carte2polar = _ <: ccplx_modul, ccplx_angle : polar_cplx; - -// Polar complex : add, sub, mul and div -pcplx_add = _, _ : polar2carte, polar2carte : ccplx_add; -pcplx_sub = _, _ : polar2carte, polar2carte : ccplx_sub; -pcplx_mul = _, _ <: (pcplx_modul, pcplx_modul : *), (pcplx_angle, pcplx_angle : +) : polar_cplx; -pcplx_div = _, _ <: (pcplx_modul, pcplx_modul : /), (pcplx_angle, pcplx_angle : -) : polar_cplx; - -process = (0.5, (PI, 4 : /) : polar_cplx), (1, (PI, 4 : /) : polar_cplx) : pcplx_div;