Forums > MaxMSP

Need Help with Precision Spectrum Analyzer

October 18, 2008 | 9:04 am

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.


October 18, 2008 | 6:34 pm

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

lh


October 19, 2008 | 5:26 am

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. –

October 19, 2008 | 5:08 pm

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


October 20, 2008 | 12:59 am

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


October 21, 2008 | 8:12 am

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


Viewing 6 posts - 1 through 6 (of 6 total)