Prev: BPSK demodulation
Next: Viterbi Decoder
From: Sohaib Afzal on 31 Dec 2009 12:39 Hi I am trying to use the goertzel algo to make a real time audio spectrum analyzer using a PIC controller. I have started out by trying it on Matlab, but i am getting this problem: The high frequency peaks in the power graph are much smaller than the low frequency peaks. For example, the peak at 60Hz is, say 50 units on the plot, then the peak at 8000Hz is only 0.023 units or so. Windows Media Player and other players show the peaks are approximately the same size throughout the sound file (.wav) that i am testing. Please tell me if this algorithm is appropriate for what i am doing, and if this difference in the magnitudes of peaks for power is usual or due to some error in coding. Thank you for your time.
From: Tim Wescott on 31 Dec 2009 13:05 On Thu, 31 Dec 2009 09:39:02 -0800, Sohaib Afzal wrote: > Hi > > I am trying to use the goertzel algo to make a real time audio spectrum > analyzer using a PIC controller. I have started out by trying it on > Matlab, but i am getting this problem: > > The high frequency peaks in the power graph are much smaller than the > low frequency peaks. For example, the peak at 60Hz is, say 50 units on > the plot, then the peak at 8000Hz is only 0.023 units or so. Windows > Media Player and other players show the peaks are approximately the same > size throughout the sound file (.wav) that i am testing. > > Please tell me if this algorithm is appropriate for what i am doing, and > if this difference in the magnitudes of peaks for power is usual or due > to some error in coding. > > Thank you for your time. Well, from the information you've given I can conclusively say that either the algorithm that you've chosen is screwed, or your code is. Hmm. That's a bit ambiguous. Could you post the difference equation that you're trying to execute? Please don't post all your Matlab code, unless it's no more than about ten lines. If you _do_ feel a need to post a Matlab program that's as long as War and Peace, extract the essential bit _first_, then put in the rest for context (and expect the "rest" to get snipped by many respondents). What does Matlab do when you perform an FFT on the data and graph that? -- www.wescottdesign.com
From: Vladimir Vassilevsky on 31 Dec 2009 13:20 What you are doing is wrong in so many ways. If your goal is nice looking visualization, just differentiate a signal, measure distance between zero crossings and display the periodogram. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com Sohaib Afzal wrote: > Hi > > I am trying to use the goertzel algo to make a real time audio > spectrum analyzer using a PIC controller. I have started out by trying > it on Matlab, but i am getting this problem: > > The high frequency peaks in the power graph are much smaller than the > low frequency peaks. For example, the peak at 60Hz is, say 50 units on > the plot, then the peak at 8000Hz is only 0.023 units or so. Windows > Media Player and other players show the peaks are approximately the > same size throughout the sound file (.wav) that i am testing. > > Please tell me if this algorithm is appropriate for what i am doing, > and if this difference in the magnitudes of peaks for power is usual > or due to some error in coding. > > Thank you for your time.
From: Jerry Avins on 31 Dec 2009 14:41 Sohaib Afzal wrote: > Hi > > I am trying to use the goertzel algo to make a real time audio > spectrum analyzer using a PIC controller. I have started out by trying > it on Matlab, but i am getting this problem: > > The high frequency peaks in the power graph are much smaller than the > low frequency peaks. For example, the peak at 60Hz is, say 50 units on > the plot, then the peak at 8000Hz is only 0.023 units or so. Windows > Media Player and other players show the peaks are approximately the > same size throughout the sound file (.wav) that i am testing. > > Please tell me if this algorithm is appropriate for what i am doing, > and if this difference in the magnitudes of peaks for power is usual > or due to some error in coding. The Goertzel algorithm is effectively a stripped Fourier transform that looks at only a few frequencies. It is useful, for example, for detecting DTMF tones. If there is a good way to use it for displaying a broad spectrum, I don't know of it. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
From: Tim Wescott on 31 Dec 2009 18:55
On Thu, 31 Dec 2009 14:41:14 -0500, Jerry Avins wrote: > Sohaib Afzal wrote: >> Hi >> >> I am trying to use the goertzel algo to make a real time audio spectrum >> analyzer using a PIC controller. I have started out by trying it on >> Matlab, but i am getting this problem: >> >> The high frequency peaks in the power graph are much smaller than the >> low frequency peaks. For example, the peak at 60Hz is, say 50 units on >> the plot, then the peak at 8000Hz is only 0.023 units or so. Windows >> Media Player and other players show the peaks are approximately the >> same size throughout the sound file (.wav) that i am testing. >> >> Please tell me if this algorithm is appropriate for what i am doing, >> and if this difference in the magnitudes of peaks for power is usual or >> due to some error in coding. > > The Goertzel algorithm is effectively a stripped Fourier transform that > looks at only a few frequencies. It is useful, for example, for > detecting DTMF tones. If there is a good way to use it for displaying a > broad spectrum, I don't know of it. If you were willing to sweep it across the frequency range it could be made to work -- but that's not what the OP says he's doing. Hmm. Need more detail... -- www.wescottdesign.com |