X-Git-Url: https://scm.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/043c676f59520b93dfacfa0d8d7e1fdd448cd7dc..1878a8448a5a73cbf289306beb5e88ab48561129:/dsp_files/fft_pattern_matching.dsp diff --git a/dsp_files/fft_pattern_matching.dsp b/dsp_files/fft_pattern_matching.dsp new file mode 100644 index 0000000..949f079 --- /dev/null +++ b/dsp_files/fft_pattern_matching.dsp @@ -0,0 +1,31 @@ +import ( "complex.lib" ) ; +import ( "fft.lib.dsp" ) ; + +concats = case { + (1) => _, 1 : vectorize ; + (m) => concats(m - 1), ( _, 1 : vectorize) : #; +}; + +//subvect_even(n) = par(i, (n/2), (_, (i, 2 : *) : [])) : concats(n/2); +//subvect_odd(n) = par(i, (n/2), (_, (i, 2 : * : _, 1 : +) : [])) : concats(n/2); + +evens = case { + (2) => [0] : vectorize(1); + (n) => evens(n-2) # ((_, (n-2) : []) : vectorize(1)); +}; + +odds = case { + (2) => [1] : vectorize(1); + (n) => odds(n - 2) # ((_, (n-1) : []) : vectorize(1)); +}; + +subvect_even(n) = _ <: evens(n); +subvect_odd(n) = _ <: odds(n); + +eo(n) = _ <: subvect_even(n), subvect_odd(n); + +output = serialize, serialize : vectorize(1), vectorize(1) : #; + +//process = (1,2,3,4,5,6,7,8) : evens(8); + +process = _ : vectorize(8) : eo(8) : output; \ No newline at end of file