Reply by Michel Rouzic June 12, 20052005-06-12
ok nevermind the question, i'm gonna do a FIR (a window-synced thing)

Reply by Michel Rouzic June 11, 20052005-06-11

Andor wrote:
> Michel Rouzic wrote: > ... > > well, 10 octaves at most (i think 20 Hz - 20 480 Hz would be way > > enough) (i consider that i always work with 44.1 kHz sounds because > > this is what i do most of the time). thats why i said 640 bands, 64 > > bands/octave, and 10 octaves, but that was just an example (and i'd say > > that i dont think i'll use more than 10 octaves nor more than 64 > > bands/octave) > > Ok, I think you can take two approaches: > > 1. A bank of 640 IIR constant Q bandpass filters. Their output can be > used to to generate the envelopes. > > 2. A proper decomposition of the signal into 640 logarithmically spaced > sin and cos functions. You can do this with either one gigantic FFT, or > using ten consecutive steps of 128-point FFT, downsampling by factor 2, > another 128-point FFT, downsampling by factor 2, etc. You have to time > align the outputs of the FFTs to compensate the downsampling filter > (this could be half-band). This gives you 64 FFT points per octave, > albeit linearly spaced (again, you can use interpolation or 256-point > FFTs to have larger resolution). > > I suggest you read up in the DSP guide (I gave you the link already) on > how to do this. rbj's filter cookbook shows you how to compute the > coefficients of the IIR bandpass filters. > > Regards, > Andor
I like the first approach better. so, i should choose IIR over FIR? i got kinda lost between FIR and IIR and all its different methods so i dont know which fits my needs the best. by the way, i realized that 64 bands/octave is not a good number since its not a multiple of 12, but thats a detail, i guess 60 should be better.
Reply by Andor June 9, 20052005-06-09
Michel Rouzic wrote:
...
> well, 10 octaves at most (i think 20 Hz - 20 480 Hz would be way > enough) (i consider that i always work with 44.1 kHz sounds because > this is what i do most of the time). thats why i said 640 bands, 64 > bands/octave, and 10 octaves, but that was just an example (and i'd say > that i dont think i'll use more than 10 octaves nor more than 64 > bands/octave)
Ok, I think you can take two approaches: 1. A bank of 640 IIR constant Q bandpass filters. Their output can be used to to generate the envelopes. 2. A proper decomposition of the signal into 640 logarithmically spaced sin and cos functions. You can do this with either one gigantic FFT, or using ten consecutive steps of 128-point FFT, downsampling by factor 2, another 128-point FFT, downsampling by factor 2, etc. You have to time align the outputs of the FFTs to compensate the downsampling filter (this could be half-band). This gives you 64 FFT points per octave, albeit linearly spaced (again, you can use interpolation or 256-point FFTs to have larger resolution). I suggest you read up in the DSP guide (I gave you the link already) on how to do this. rbj's filter cookbook shows you how to compute the coefficients of the IIR bandpass filters. Regards, Andor
Reply by Jerry Avins June 9, 20052005-06-09
Michel Rouzic wrote:
>>Yes. With 64 bands per octave, divide the sample count I thought you >>needed by ten; you need only a tenth as many. (141,120) They all have to >>be real: zero padding won't do if you want actual information, rather >>than just a smooth curve through points made up to look pretty. >> >>Jerry >>-- >>Engineering is the art of making what you want from things you can get. >>����������������������������������������������������������������������� > > > i know, but if i want to do a bandpass to a sound one second long, it > may be easier when the band i want to pass is 128 samples long (even if > it's smooth due to zero-padding) than if it's 0.2 samples long. > because, the whole thing is indeed about making a bandpass filter. ok, > maybe its not the most efficient to do a bandpass filter (mostly if it > involves adding millions of zeros and loading your RAM by hundreds of > MB's) but i didnt manage to understand how IIR or FIR works nor if it > could do what i want to do (like filtering right between 19.892 and > 20.109 Hz). i'm sure you guys can help me out explaining me a better > way to make a bandpass or bandstop filter that can do what i want to do
If you want to make something that meets your expectations, I suggest you learn a bit more. Why not go through the free www.dspguide.com and ask here about any parts that aren't clear to you. There is also a good tutorial at http://www.bores.com/courses/intro/index.htm and http://www.bores.com/courses/advanced/index.htm Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by Michel Rouzic June 9, 20052005-06-09
> Yes. With 64 bands per octave, divide the sample count I thought you > needed by ten; you need only a tenth as many. (141,120) They all have to > be real: zero padding won't do if you want actual information, rather > than just a smooth curve through points made up to look pretty. > > Jerry > -- > Engineering is the art of making what you want from things you can get. > =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF i know, but if i want to do a bandpass to a sound one second long, it may be easier when the band i want to pass is 128 samples long (even if it's smooth due to zero-padding) than if it's 0.2 samples long. because, the whole thing is indeed about making a bandpass filter. ok, maybe its not the most efficient to do a bandpass filter (mostly if it involves adding millions of zeros and loading your RAM by hundreds of MB's) but i didnt manage to understand how IIR or FIR works nor if it could do what i want to do (like filtering right between 19.892 and 20.109 Hz). i'm sure you guys can help me out explaining me a better way to make a bandpass or bandstop filter that can do what i want to do
Reply by Jerry Avins June 8, 20052005-06-08
Michel Rouzic wrote:
>>Jerry, he isn't! He's trying to tell you he doesn't want to window 256 samples >>(see above). > > > yeah, indeed, i'm rather trying to use a few million samples. i think > i've been a bit misunderstood. > > firstly, where is that 1/32nd of a hertz thing coming from? cuz it > seems that you got it from doing (40 Hz - 20 Hz) / 640 (correct me if > i'm wrong). > > First of all, there isnt 640 bands by octaves but 64 (which is already > pretty much). 640 is the total number of bands for the 10 octaves. and > then, in order to calculate the width of the lowest band, provided that > i choose it to be 20 Hz and that there will be 64 bands/octave, i > calculate that the band will be between > > 20 * 2**(-1/128) = 19.892 Hz > > and > > 20 * 2**(1/128) = 20.109 Hz > > which makes a band width of 0.217 Hz, in other words about 1/5th of a > hertz. > > In order for me to have a desired number of samples in the frequency > domain representing that band, provided that i want for example 128 > samples (in order to make a good bandpass or bandstop depending on what > i experiment to do), i will add enough zeros in the time domain so i > have a total of 26 million samples in the time domain. > > i hope i made myself clearer this time
Yes. With 64 bands per octave, divide the sample count I thought you needed by ten; you need only a tenth as many. (141,120) They all have to be real: zero padding won't do if you want actual information, rather than just a smooth curve through points made up to look pretty. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by Michel Rouzic June 8, 20052005-06-08
> Jerry, he isn't! He's trying to tell you he doesn't want to window 256 samples > (see above).
yeah, indeed, i'm rather trying to use a few million samples. i think i've been a bit misunderstood. firstly, where is that 1/32nd of a hertz thing coming from? cuz it seems that you got it from doing (40 Hz - 20 Hz) / 640 (correct me if i'm wrong). First of all, there isnt 640 bands by octaves but 64 (which is already pretty much). 640 is the total number of bands for the 10 octaves. and then, in order to calculate the width of the lowest band, provided that i choose it to be 20 Hz and that there will be 64 bands/octave, i calculate that the band will be between 20 * 2**(-1/128) = 19.892 Hz and 20 * 2**(1/128) = 20.109 Hz which makes a band width of 0.217 Hz, in other words about 1/5th of a hertz. In order for me to have a desired number of samples in the frequency domain representing that band, provided that i want for example 128 samples (in order to make a good bandpass or bandstop depending on what i experiment to do), i will add enough zeros in the time domain so i have a total of 26 million samples in the time domain. i hope i made myself clearer this time
Reply by Jerry Avins June 8, 20052005-06-08
Jon Harris wrote:
> "Jerry Avins" <jya@ieee.org> wrote in message > news:aYidnYBTIO7x0jrfRVn-uQ@rcn.net... > >>Michel Rouzic wrote: >> >>>>I suspect that you're overlooking an important point. To discriminate >>>>frequencies f Hz apart. you need 1/f seconds of data. 1 Hz: 1 sec.; 0.1 >>>>Hz: 10 sec., etc. 640 separate frequencies in the octabe starting at 20 >>>>Hz will be at most 1/32nd Hz apart. You will need 32 seconds of data. At >>>>44.1 KHz, that's nearly a million and a half samples. 256 won't do! >>>> >>>>Jerry >>> >>> >>>i know! i know that thats why i dont wanna do a window of 256 samples >>>in the time domain. as i said in a previous post, if i do a window of > > <snip> > >>Why do you keep thinking 256? >> >>Jerry > > > Jerry, he isn't! He's trying to tell you he doesn't want to window 256 samples > (see above).
OK. So he and I agree that 256 is not the number. How many samples at 44.1 KHz does he need to separate frequencies 1/32nd Hz apart? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Jon Harris June 8, 20052005-06-08
"Jerry Avins" <jya@ieee.org> wrote in message
news:aYidnYBTIO7x0jrfRVn-uQ@rcn.net...
> Michel Rouzic wrote: > >>I suspect that you're overlooking an important point. To discriminate > >>frequencies f Hz apart. you need 1/f seconds of data. 1 Hz: 1 sec.; 0.1 > >>Hz: 10 sec., etc. 640 separate frequencies in the octabe starting at 20 > >>Hz will be at most 1/32nd Hz apart. You will need 32 seconds of data. At > >>44.1 KHz, that's nearly a million and a half samples. 256 won't do! > >> > >>Jerry > > > > > > i know! i know that thats why i dont wanna do a window of 256 samples > > in the time domain. as i said in a previous post, if i do a window of
<snip>
> > Why do you keep thinking 256? > > Jerry
Jerry, he isn't! He's trying to tell you he doesn't want to window 256 samples (see above).
Reply by Jerry Avins June 8, 20052005-06-08
Michel Rouzic wrote:
>>I suspect that you're overlooking an important point. To discriminate >>frequencies f Hz apart. you need 1/f seconds of data. 1 Hz: 1 sec.; 0.1 >>Hz: 10 sec., etc. 640 separate frequencies in the octabe starting at 20 >>Hz will be at most 1/32nd Hz apart. You will need 32 seconds of data. At >>44.1 KHz, that's nearly a million and a half samples. 256 won't do! >> >>Jerry >>-- >>Engineering is the art of making what you want from things you can get. >>&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295; > > > i know! i know that thats why i dont wanna do a window of 256 samples > in the time domain. as i said in a previous post, if i do a window of > 256 samples in the time domain, provided that it's sampled at 44.1 kHz, > the lowest frequency it should detect should be 86 Hz, right? indeed, > in my previous post i said i'd even add zeros in the time domain if > there isnt enough to obtain lots of samples even in the first band. > > and damn, i'm glad we're in 2005 cuz if computers couldnt handle > gigabytes in RAM/Virtual memory i coudlnt do anything. > > by the way, dont wanna give me a lil opinion on the trick i talked > about earlier about getting sharp envelopes?
Time domain or frequency: it doesn't matter. You want to resolve the octave from 20 Hz to 40 Hz -- that's 20 Hz -- into 640 frequencies. Even if they're evenly spaced, the separation is 1/32nd of a Hz, so you need 32 seconds worth of data. That's 32*44,100, or 1,411,200 samples in your FFT. (The next higher power of two is 2,097,152.) Why do you keep thinking 256? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;