examples/filter/FIR-convolve-homer.ck
raw| 1 | // FIRConvolveHomer.ck by Perry R. Cook, 10/12 |
| 2 | // Use FIR to convolve mic input with "dope!" |
| 3 | |
| 4 | adc => Gain g => FIR imp => dac; |
| 5 | SndBuf s => dac; |
| 6 | "special:dope" => s.read; |
| 7 | |
| 8 | s.samples() => imp.order; |
| 9 | for (0 => int i; i < imp.order(); i++) { |
| 10 | imp.coeff(i,s.last()); |
| 11 | 1.0 :: samp => now; |
| 12 | } |
| 13 | |
| 14 | 5.0 :: second => now; |
| 15 | |
| 16 |