From cc8ed2bd6bd5a60156d63040b2d352ad5b1a3095 Mon Sep 17 00:00:00 2001 From: WANG Date: Thu, 29 Aug 2013 18:19:18 +0200 Subject: [PATCH 1/1] Add fft, 2d_fft and sinwave to examples. --- examples/2d_fft/fft2d.dsp | 51 ++++++++++++++++++ examples/2d_fft/fft2d.sh | 2 + examples/2d_fft/hcosine-32.csv | 32 +++++++++++ examples/2d_fft/output1.csv | 32 +++++++++++ examples/fft/fft.dsp | 18 +++++++ examples/fft/fft.sh | 1 + .../fft/sin_1378Hz_0.005_ampli_128samples.wav | Bin 0 -> 300 bytes .../sin_16536Hz_0.005_ampli_128samples.wav | Bin 0 -> 300 bytes .../fft/sin_2067Hz_0.005_ampli_128samples.wav | Bin 0 -> 300 bytes .../sin_22000Hz_0.005_ampli_128samples.wav | Bin 0 -> 300 bytes examples/sinwave/output1.wav | Bin 0 -> 131114 bytes examples/sinwave/sin.dsp | 19 +++++++ examples/sinwave/sin.sh | 1 + 13 files changed, 156 insertions(+) create mode 100644 examples/2d_fft/fft2d.dsp create mode 100644 examples/2d_fft/fft2d.sh create mode 100644 examples/2d_fft/hcosine-32.csv create mode 100644 examples/2d_fft/output1.csv create mode 100644 examples/fft/fft.dsp create mode 100644 examples/fft/fft.sh create mode 100644 examples/fft/sin_1378Hz_0.005_ampli_128samples.wav create mode 100644 examples/fft/sin_16536Hz_0.005_ampli_128samples.wav create mode 100644 examples/fft/sin_2067Hz_0.005_ampli_128samples.wav create mode 100644 examples/fft/sin_22000Hz_0.005_ampli_128samples.wav create mode 100644 examples/sinwave/output1.wav create mode 100644 examples/sinwave/sin.dsp create mode 100644 examples/sinwave/sin.sh diff --git a/examples/2d_fft/fft2d.dsp b/examples/2d_fft/fft2d.dsp new file mode 100644 index 0000000..c77a660 --- /dev/null +++ b/examples/2d_fft/fft2d.dsp @@ -0,0 +1,51 @@ +import ( "../../architecture/fft.lib" ) ; +import ( "../../architecture/complex.lib" ) ; + +GREY_MAX = 256; + +//fft2d(x,y) = vectorize(x) : vectorize(y) <: picks(n) : real2complex(n) : fft(n) : stops(n/2), pcplx_moduls(n/2) : modules_vector(n/2); +//fft2d(x,y) = vectorize(x) : vectorize(y) : fft(x) : fftc(y) : pcplx_moduls(y) : modules_vector(y); +//fft2d(x,y) = vectorize(x) : fft(x) : fftc(y) : pcplx_moduls(y) : modules_vector(y); + +matricize(x, y) = vectorize(y) : vectorize(x); + +ffts(n, m) = par(i, n, (fft(m) : nconcat(m))); + +fftcs(n, m) = par(i, n, (fftc(m) : nconcat(m))); + +lines_fft(n, m) = _ <: picks(n) : ffts(n, m) : nconcat(n); + +lines_fftc(n, m) = _ <: picks(n) : fftcs(n, m) : nconcat(n); + +take_column(n, m) = par(i, n, [m]) : nconcat(n); + +matrix_transpose(n, m) = _ <: picks(n) <: par(i, m, take_column(n, i)) : nconcat(m); + +matrix_pcplx2modul(n, m) = _ <: picks(n) : par(i, n, ( _ <: picks(m) : pcplx_moduls(m) : nconcat(m))) : nconcat(n); + +matrix_real2pcplx(n, m) = _ <: picks(n) : par(i, n, ( _ <: picks(m) : real2pcplx(m) : nconcat(m))) : nconcat(n); + +//normalize(n) = _ , n : /; +normalize(n, m) = _, (m : vectorize(n)) : /; + +unnormalize(n) = par(i, n, ( _ , GREY_MAX : *)); + +norm_out(n, m) = _ <: picks(n) : par(i, n, ( _ <: picks(m) : unnormalize(m) : nconcat(m))) : nconcat(n) : serialize; + +output(n, m) = serialize; + +//fft2d(x, y) = matricize(x, y) : lines_fft(x, y) : matrix_transpose(x, y) : lines_fftc(y, x) : matrix_transpose(y, x) : output(x, y); +//fft2d(x, y) = normalize(GREY_MAX) : matricize(x, y) : lines_fft(x, y) : matrix_transpose(x, y) : lines_fftc(y, x) : matrix_transpose(y, x) : norm_out(x, y); +//fft2d(x, y) = matricize(x, y) : matrix_real2pcplx(x, y) : matrix_pcplx2modul(x, y) : output(x, y); +//fft2d(x, y) = matricize(x, y) : output(x, y); +fft2d(x, y) = normalize(GREY_MAX) : matricize(x, y) : lines_fft(x, y) : matrix_transpose(x, y) : lines_fftc(y, x) : matrix_transpose(y, x) : norm_out(x, y); + +new_fft2d(x, y) = normalize(y, GREY_MAX) : vectorize(x) : lines_fft(x, y) : matrix_transpose(x, y) : lines_fftc(y, x) : matrix_transpose(y, x) : norm_out(x, y); + +//safer with x=y because tests and zero padding are still to implement +//process = fft2d(32,32); + +process = new_fft2d(32,32); + + + diff --git a/examples/2d_fft/fft2d.sh b/examples/2d_fft/fft2d.sh new file mode 100644 index 0000000..b77b205 --- /dev/null +++ b/examples/2d_fft/fft2d.sh @@ -0,0 +1,2 @@ +../../interpretor/faustine -d fft2d.dsp -i hcosine-32.csv --oformat csv + diff --git a/examples/2d_fft/hcosine-32.csv b/examples/2d_fft/hcosine-32.csv new file mode 100644 index 0000000..14d3ba6 --- /dev/null +++ b/examples/2d_fft/hcosine-32.csv @@ -0,0 +1,32 @@ +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 +217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217,217,38,38,217 diff --git a/examples/2d_fft/output1.csv b/examples/2d_fft/output1.csv new file mode 100644 index 0000000..9112295 --- /dev/null +++ b/examples/2d_fft/output1.csv @@ -0,0 +1,32 @@ +130560.,0.,0.,0.,0.,0.,0.,0.,64804.9222822,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,64804.9222822,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.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.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. \ No newline at end of file diff --git a/examples/fft/fft.dsp b/examples/fft/fft.dsp new file mode 100644 index 0000000..41ad1fe --- /dev/null +++ b/examples/fft/fft.dsp @@ -0,0 +1,18 @@ +import ( "../../architecture/fft.lib" ) ; +import ( "../../architecture/complex.lib" ) ; + + + +//fft_test(n,m) = _ : overlap(n,m) <: picks(n) : real2complex(n) : fft(n) : stops(n/2), pcplx_moduls(n/2) : modules_vector(n/2); +//fft_test(n,m) = _ : overlap(n,m) : fft(n) : stops(n/2), pcplx_moduls(n/2) : nconcat(n/2); +fft_test(n,m) = vectorize(n) : fft(n) : pcplx_moduls(n) : nconcat(n); + +//process = +, _ : + : fft_test(128,128); +process = fft_test(128,128) : serialize; +//process = (0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7) <: shuffle(8); + + + + + + diff --git a/examples/fft/fft.sh b/examples/fft/fft.sh new file mode 100644 index 0000000..03de52b --- /dev/null +++ b/examples/fft/fft.sh @@ -0,0 +1 @@ +../../interpretor/faustine -d fft.dsp -i sin_22000Hz_0.005_ampli_128samples.wav diff --git a/examples/fft/sin_1378Hz_0.005_ampli_128samples.wav b/examples/fft/sin_1378Hz_0.005_ampli_128samples.wav new file mode 100644 index 0000000000000000000000000000000000000000..7d4c8960f2666bafb701950f2f3622997033293c GIT binary patch literal 300 zcmXYs-AV#c7)6&oflp9l^cax{C3M?Gf74h4l9hB(3?p`5*d*OVe*}T1(nar(_8_4> zh`XJ1&ehp`>s$M5te4A6IoK*~t{t8xK_1BYu6{skJI5S(s&NuK@(EZW;*2(T^yu=& zJsIazSZ0x_el${FZ8dbFiX!dnNKM^18)+gbpvW#MS3J=%-Q|I65<=$-R!sD%cV%Xd z&4!9qoACn;%}-UZKlFTy#~I(@*}GEjEdKk48ra`7cVK^{x>CRY{A2qI?pbmF%-#-t hUU}h?20N6P_g}~QQct&L>h8bi9W`CJPv7~segPG>i8TNK literal 0 HcmV?d00001 diff --git a/examples/fft/sin_16536Hz_0.005_ampli_128samples.wav b/examples/fft/sin_16536Hz_0.005_ampli_128samples.wav new file mode 100644 index 0000000000000000000000000000000000000000..e48ffb6a768cb3ebbb03a0d6f40d233f04d9301d GIT binary patch literal 300 zcmYj~OAY}+07R?F>>a_vMI=aUE&M-`h@D_G;slss#ufZGZs=2Le3I$jbalO|DisTb zi~%aya=t&X=@bB?o4Wz4szCxN^t!gIFCB{}Ey#dJY-r%3&58cEJRszgGc@EIc)ViG zB*q`#z~@;!IaPk5PA{gveS7Sbk9_;<3&dNr=!*Aw(nh4)9Kpegmsp?C`=I=t3)I9U qw0#l(itU{c{IrXt_9Ok|9Ch*k{6l<)L-nuahkVFyXy3u|)At5A(}g<# literal 0 HcmV?d00001 diff --git a/examples/fft/sin_2067Hz_0.005_ampli_128samples.wav b/examples/fft/sin_2067Hz_0.005_ampli_128samples.wav new file mode 100644 index 0000000000000000000000000000000000000000..a8524b70c32ccb9cd4d6c786cf60d614dc3cd236 GIT binary patch literal 300 zcmX}mJxfAi7{>Ac=>yd16C}~@P;()e5WNfyCZX05GaXJ49c(Cqvf)r*BncWtZ@M)k z^Z_bpkDxhnkJ^K-ZkO(7yYGkVcg;^F5+e>Q#FCQ*KZv-1V=sOSValNom%JBvwz7$m zVVhGfX;G!jG{b!9QB9Rq(4z9%R6|et)(~@SaBM%@)Y&D)D8G7DOM5CQEl<9Vbf>QR ziLt@~XO?+RNRbH!dDp!TwXUp|EO}p7dee`_NK)a%GB2nRFl+v&o>kYDC1#Z~zo`fF yBh1*n=iks^$9hMtf6uR|sEn4irmFcL8erVa@ZT?)@6uJr`uUca)~fl}deI;Lb%!?q literal 0 HcmV?d00001 diff --git a/examples/fft/sin_22000Hz_0.005_ampli_128samples.wav b/examples/fft/sin_22000Hz_0.005_ampli_128samples.wav new file mode 100644 index 0000000000000000000000000000000000000000..93556f15c5f8d4c903a3f6dbad4097261d058b42 GIT binary patch literal 300 zcmXZRF(^a<9LMqRV~~Y6NCslKMJbVz!63Z4WMH_v4Dxg-z_!an_R%L>nlM%;ZTN4(og#~ z1)o2a^Q#Je%(p7}QWc-7HZC8k;a#=7sg76G^P+~pvl@9)ghw^=pcd}Uom#n78#ih< z9bBuED|K-hx==Ug>g7xxr{+Xajy1rc201bZ8lt2aMa9_{4NXx{iuJGsO|zyMRyE7A=E<8SWvp|o1Y3qhWyvW=Rtx+C)+2>_ literal 0 HcmV?d00001 diff --git a/examples/sinwave/output1.wav b/examples/sinwave/output1.wav new file mode 100644 index 0000000000000000000000000000000000000000..5a728e2cca463cca0edf2c8809f3d1fd42fa0231 GIT binary patch literal 131114 zcmeI*`CmBvp)o_rT4N?nNE-jd{Pud>AMelSalYsKd4AsSg|qGKhDo|fT&-PfR|SR| z=tv|I>6f2Pu|$%zSo-B39f`MRsORS{>6d>@bvuS@Ptdk4T$H{dVU0s*S=7GRF5z-) zdsK0#dVqpZx22WuAXr=@bL7!&h1Z9^p#a|EwMqI7e8fF@>boP?83$qs%y$R%U7Qwev_ucx&>Sdw>9{_cWje{_`@;j%)R+Ae@TXzz zopTRLWczyTEZtnJ91^E5mWU4&%8l9Sud`f5xwXJomoUhow>Vs37DxOTs{&*G&HHIw^}j?(kiFnu@f>Ft|-7iN{7R}IKaOtnc2 zi!&GFM1MtH(vh_4UGMT=m3d$8e^=FX?0s{uH-nwcYNko&hl{zdJ;$gCAxo+RFin=87DYKpN*wOdNF z@(-*#dhL?i?YhP%|LXS~{!OmQ_^By#U6#&WHD=w7@J}%+p-dPfGl)>Ft6wEuHrr8s zn#{D`Y!7U!^ zv+J?=>*u3)PSKsCxy0PZF~}%*r-xui6cb2xHhF;>c*XVs!d0Bo_}BK_{6$3qWjiCV@G|Olr_8D zwXe6=+K3HCF-}60&?s|>ToC-pSLtr-WMSQCo;9?nPgsZR%aZ$bS4W+ASD@HEaBIWH ze(~2uU9nZ}skGlL?x@c*EYUn?Uz7Mp(BCSxD+9ttF0s;^<>~TzWk_H}SZVZNp-r%i zeGzFG(%t{^@*N8<&Bz$L+%R0*rqkfH?}Lb63r;!|73OGUWNu1{m&i551M=GmQ7KW| z^Y)%R6nQ4|M#b-Y{;HL>_dEXGQOgWF4d?TovVfjp6QZBSb_zmlaMa5XjWr)UJ}jJL zGiChX;r4y?x?0|hd^EJu>{P+e_xF6xa7ormm@1cw?sA8OvgF8ZYjPJAH=k;*l+@QW zcXaW@@x<}O@x<|t;~mF4j#DM4N=}uWD*2A%JC5%-Zcey4;pT*!6YeUxtK_bd=>XFK zrUT65n8z`XV;;u@oC!D+aLftj1apEpL3yFPP+qu7TqUj&SBYdsG9#JU9bk8W-2t|B z*w$fNhix79`FVgc!&m%pLyh`#a$*Ux, ""); +//floor = ffunction(float floor(float), , ""); +PI = 3.141592653589; + +tablesize = 40000; +samplingfreq = 44100.; + +time = (+(1)~_) - 1; +sinwavform = time * (2 * PI)/tablesize : sin; + +decimal = _ <: -(floor); +phase(freq) = freq / samplingfreq : mem : ( + : decimal) ~ _ : * (tablesize) : int; +osc(freq) = phase(freq) : rdtable(tablesize, sinwavform); + +vol = 1; +freq = 1000; + +process = osc(freq) * vol; +//process = freq / samplingfreq : @(1): ( + : decimal) ~ _ : * (tablesize) : int ; diff --git a/examples/sinwave/sin.sh b/examples/sinwave/sin.sh new file mode 100644 index 0000000..3a4b202 --- /dev/null +++ b/examples/sinwave/sin.sh @@ -0,0 +1 @@ +../../interpretor/faustine -d sin.dsp -- 2.20.1