Reply by aaab January 22, 20132013-01-22
Hi all, 

As Tim Wescott rightly mentioned that an integer value of cycles are to be

taken for fft. I was not doing so and hence not getting sane values. 
Thanks Tim. 

I will pursue my work on Multi-band Amplitude compression in the frequency

domain. 

Regards,
AV.
Reply by Tim Wescott January 21, 20132013-01-21
On Mon, 21 Jan 2013 07:25:30 -0600, aaab wrote:

> Hi all, > > When I use different number of samples to do the fft, > I get fft spectra values which are different in value. > So say I have a tone at 1500 Hz at sampling frequency of 20000 Hz of 1 > second duration. > First I take only the first 512 samples and find the fft. > Then I take only the first 1024 samples of the same input and find the > fft. The maximum absolute value of these two ffts are found to be > different. > > Please let me know what can I do to ensure that fft spectra values can > be compared irrespective of the number of samples taken for fft (or > window length). > > Here is the sample Matlab code for illustration. > > For compression in the frequency domain I need to address this issue. > >>>t= [1:20000];s = 0.999 * sin(2 * pi * 1500/20000 * t); > >>> s2 = s(1:512); fft_s2 = fft(s2); plot(abs(fft_s2)); > >>> s3 = s(1:1024)); fft_s3 = fft(s3); plot(abs(fft_s3)); > > It is seen that max(abs(fft_s2)) is different from max(abs(fft_s2)) > since number of samples are different. But I want to be able to compare > or > > get a relation between these values irrespective of the number of > samples used for fft. > > Thanks and regards, > AV
You did not post your values. Are they different by a factor of 2, or a factor of sqrt(2)? Or are they different by a percent or less? If it's one of the former two, then it's an artifact of the algorithm which you can take care of by scaling your results by the number of points. If it's the latter, then try taking your measurements again, but use a tone that'll fit an integer number of cycles into the number of points over which you FFT. I'm not sure what math package you're using (I come late to the thread and you haven't included context), and I don't care. What's important is that different math packages scale their FFT results differently. Some scale it so that a constant-amplitude tone always gives the same results (assuming an integer number of cycles), some just let it be scaled by the number of points. Nearly all of them use algorithms such that ifft(fft(x)) = x + numerical scrud This means that the ifft and fft algorithms are the same except that one multiplies by a kernel that's the complex conjugate of the other's, and that the scaling is off by a factor of N, N being the number of points. Some packages don't scale the fft and fix it all in the ifft. Some packages fix it all in the fft and don't scale the ifft. Some packages scale one by sqrt(N) and the other by sqrt(1/N). Your job is to figure out what your package does, and adjust your use of the FFT accordingly. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
Reply by aaab January 21, 20132013-01-21
Hi all, 

When I use different number of samples to do the fft, 
I get fft spectra values which are different in value. 
So say I have a tone at 1500 Hz at sampling frequency of 20000 Hz 
of 1 second duration. 
First I take only the first 512 samples and find the fft. 
Then I take only the first 1024 samples of the same input and 
find the fft. The maximum absolute value of these two ffts are found to be
different. 

Please let me know what can I do to ensure that fft spectra values can
be compared irrespective of the number of samples taken for fft (or window
length). 

Here is the sample Matlab code for illustration. 

For compression in the frequency domain I need to address this issue. 

>>t= [1:20000];s = 0.999 * sin(2 * pi * 1500/20000 * t);
>> s2 = s(1:512); fft_s2 = fft(s2); plot(abs(fft_s2));
>> s3 = s(1:1024)); fft_s3 = fft(s3); plot(abs(fft_s3));
It is seen that max(abs(fft_s2)) is different from max(abs(fft_s2)) since number of samples are different. But I want to be able to compare or get a relation between these values irrespective of the number of samples used for fft. Thanks and regards, AV
Reply by aaab December 24, 20122012-12-24
Dear all, 

Thanks for your posts. I will refer to them and get back 
in case I have more queries. 

Regards,
AV.
Reply by dbd December 19, 20122012-12-19
On Monday, December 17, 2012 3:18:12 AM UTC-8, aaab wrote:
> Dear all, > > I would like to get started on Multiband Amplitude Compression in > the Frequency Domain. So basically I would like to do the processing > like Compression of the signal on frequency spectra (bins). >
What is your motivation? (Answers to that, both personally and algorithmically may enable and motivate more useful responses.)
> > Can anybody suggest any links or references from where I could > get an understanding of how can I do it ? >
http://www.rehab.research.va.gov/jour/93/30/1/pdf/kollmeier.pdf http://www.ti.com.cn/cn/lit/an/spra657/spra657.pdf http://nemertes.lis.upatras.gr/jspui/bitstream/10889/2391/1/ThesisSESE.pdf http://ticet.iitb.ac.in/ticet/publications/Long%20Term%20Research%20Projects/kulkarni_pandey_jangamashetti_July09.pdf Dale B. Dalrymple
Reply by Greg Berchin December 19, 20122012-12-19
On Tuesday, December 18, 2012 11:35:25 PM UTC-6, aaab wrote:

> I am seeking much more details in terms of > the core algorithm and sound pressure measurement to be used.
I think you'll find that (1) there aren't very many, and (2) the few that do exist are proprietary and thus not much info is available about them. Greg
Reply by Christian Gollwitzer December 19, 20122012-12-19
Am 17.12.12 12:18, schrieb aaab:
> I would like to get started on Multiband Amplitude Compression in > the Frequency Domain. So basically I would like to do the processing > like Compression of the signal on frequency spectra (bins). > > Can anybody suggest any links or references from where I could > get an understanding of how can I do it ?
Postfish is an excellent audio processing software which includes a multi-band compander and is open source: http://svn.xiph.org/trunk/postfish/ Look into this file http://svn.xiph.org/trunk/postfish/multicompand.c Unfortunately, it doesn't work on modern Linux boxes. I could get it compiled and running on an Ubuntu 8.04 virtual machine, though. It would be great to see an updated port to use it on modern OSes. Christian
Reply by niarn December 19, 20122012-12-19
>Dear all, > >I would like to get started on Multiband Amplitude Compression in >the Frequency Domain. So basically I would like to do the processing >like Compression of the signal on frequency spectra (bins). > >Can anybody suggest any links or references from where I could >get an understanding of how can I do it ? > >Thanks in advance, >AV. >
I can imagine that a book (if such a book actually exists) on designing hearing aids would be of interest. cheers
Reply by aaab December 19, 20122012-12-19
Hi Greg, Vladimir, et. al.,

Thanks for your replies. 

I am seeking much more details in terms of 
the core algorithm and sound pressure measurement to be used. 

Regards,
AV.





>http://www.proaudiodsp.com/ >
Reply by Greg Berchin December 17, 20122012-12-17
http://www.proaudiodsp.com/