annotate dsp/synth/poly2snd.m @ 47:82075c94eed1
adding a bunch of stuff, including graphics and pitch toolboxes.
author |
samer |
date |
Sat, 17 Jan 2015 15:20:35 +0000 |
parents |
c75bb62b90a9 |
children |
|
rev |
line source |
samer@34
|
1 function X=poly2snd(A,u)
|
samer@34
|
2 % POLY2SND - Convert array of filter polynomial coeffs to one long sound by filtering noise
|
samer@34
|
3 % Filter state is preserved as the function processes a number of filters
|
samer@34
|
4 %
|
samer@34
|
5 % poly2snd ::
|
samer@34
|
6 % (A:array 1..N of Poly, signal~'noise to filter')
|
samer@34
|
7 % ->signal~'N concatentated sounds'
|
samer@34
|
8 %
|
samer@34
|
9 % Each ROW of A contains coefficients for one filter
|
samer@34
|
10
|
samer@34
|
11 Z=[];
|
samer@34
|
12 for k=1:size(A,1)
|
samer@34
|
13 [x,Z]=filter(1,A(k,:),u,Z);
|
samer@34
|
14 if any(isnan(Z)), Z=[]; end;
|
samer@34
|
15 X(:,k)=0.999*x/max(abs(x));
|
samer@34
|
16 end
|
samer@34
|
17
|
samer@34
|
18
|