Need Help with Precision Spectrum Analyzer

Oct 18, 2008 at 9:04am

Need Help with Precision Spectrum Analyzer

I need a program for getting precise frequency response data. I am testing external hardware and need a lot of graph data I can throw around and manipulate in MATLAB/Excel. Since I only care about the audio range, it makes the most sense to work with my soundcard. RightMark Audio Analyzer’s sine sweep analyzer is what I’ve been using lately for guesstimates, but it has too many limitations:

*Not customizable in terms of sweep range
*Can’t be scripted
*No control of external devices
*No CSV output (so easily done in Max!)
*No ASIO support
*No phase response handling from the sweep
*Not stable, it crashes very often for me

So I want to make a Max patch that does the job and addresses all of these issues. The first problem is getting accurate level measurements of sine wave amplitude. My first thought was to use the average~ rms object:

– Pasted Max Patch, click to expand. –

…but that is only really accurate when the sine wave frequency is an integer division of the sample rate. When that condition isn’t met, the averaging isn’t synchronized to the sine wave and oscillating error appears. At low frequencies that error can be bad even with very large sample settings on the average~ object. Is there a better way?

Also, is there an easy way to calculate phase difference?

Any help would be awesome. I hope to keep the project as “open” as possible with all the code available to everyone.

#40397
Oct 18, 2008 at 6:34pm

Perhaps have a look at Tristan Jehans’ [loudness~] external which is included in the CNMAT package.

lh

#142888
Oct 19, 2008 at 5:26am

I just looked it up, but it seems to be OSX only. Is there anything cross-platform?

The average~ object isn’t behaving well at all for me at low frequencies. Here is an example:

– Pasted Max Patch, click to expand. –
#142889
Oct 19, 2008 at 5:08pm

Quote: skrasms wrote on Sat, 18 October 2008 22:26
—————————————————-
> I just looked it up, but it seems to be OSX only. Is there anything cross-platform?
>

Windows loudness:

http://web.media.mit.edu/~tristan/MaxMSP/WinLoudness%7E.zip

mz

#142890
Oct 20, 2008 at 12:59am

Windows Loudness really doesn’t want to work on my system. It doesn’t recognize the version of fftw3.dll that I have.

#142891
Oct 21, 2008 at 8:12am

Aaron Faulstich schrieb:
> The average~ object isn’t behaving well at all for me at low
> frequencies. Here is an example:

What is wrong with it? Your snapshot~ is like a sample & hold for your
slow changing signal. I’d call it an expected result… (Think, that no
matter how many cycles you average, it wouldn’t change anything in the
result you have more or less the same change at both ends. A sine wave
is not a statistical signal…)

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#142892

You must be logged in to reply to this topic.