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:
----------begin_max5_patcher---------- 698.3oc2X1riaBCEEdMiz7NX4kUoQXyuo65CP21MUipb.mD2BFD1YZlYTyyd sMgLjzjARf.S6Frhs45y8KmK1vK2emEbd1Fp.B9D3a.KqWT8XY5S2iUUGVvT xlnDhvLQHec5bZAbxtwT+LasLgJMihq5dQFWxIoTys74BFIY+cTNc4S4zxEF x3R3D.bNguDBdnZZrXy8lM+GezwCVOtB1ylaEgmZW0eNQFshwW98BZjrLtt9 yTiCPdd5FOa8Ur55qKgR6LdkzQlN+882oaUMSZMQVjjohTeRDUDIMwDmqgIN AtFlftwHgS+kRj6UnjtwH.nrfvEIDIEr5YffjlmnremFbnqAbmlU3ft3evAk MnaFshxRSo5hfiw0WnDw5BZL3qYIqUD3zjxtEjpFMP966MufJTKLQxx30cIn Pct53ZRY6cWdMsuDC2AgBYGL7PrWYWPSryM.aRwvNitChjGZvqU+v19rxTvV xUiex5STXiNRGS9G32cCY8H4fm58lTE+u0lBnYMZO8LlpxqcydVORg3QvdBP ScQtXj6P4Sw1M5SK2r.6Z2ci5Agpzu9+iSEiZFkk6bfv8.JqGpP+A2qJ3jbw pL4VPMKTOXVKA8oALFd8jBGXN5SnyMyzcNRojBk8HcKXA4mTU9hGrZ6q67z6 NbXfS4waFAqEkG2HstvS4fcgW+NqHaSU1LmAGEQOEkP66Rr2zy30AN4ZdsTe 7fWhQdjVPVpAE11CTjJFLb42gGIglU91XH2KzWUNMXBi+WeoCypoG3HLJxVW DUkQUe.BPsELlJjLtYGqZyRme0m0JVbLkeP8WJKNOiwk6TB3gy+uaqEm9saa VbGmBCj3zelhVPtf2yhabH2wtoyHN6wQbNumKHvsRbnwQb1sRb3QQb5WDuEh ycbHWqdH7wovPQtYsVbnNINcGpl+.j4GJsN -----------end_max5_patcher-----------
…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.
Perhaps have a look at Tristan Jehans’ [loudness~] external which is included in the CNMAT package.
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:
----------begin_max5_patcher---------- 830.3oc2X1zaaBCGF+bpT+NXwwptJrMlW1scZm10cYpZxEbS7JXGgMc8Es7Y eF6lTZaHgBIP2tDq3WfG9wyye.+3omLy6J4cLkG3yfe.lM6QSOyr8U2yr0cL yqfdWZNUYmnmf8a4U+x67mFSytSa6OWRyJXJE.g2LnnpPVoyYZ6Rgq69ZoPK nEL659RImluYEtoqueIyoJOOvkqGimYWf4r+ILwq4ASwevNeH5B+08ujpSWv Ey+YIKU6NXgDhYbPj8mj5eQ9W3+7IvHWtXiZsc9mSOot0zbdmITprnfIzuEQ ekoAEU4Z9xbFH89zblBnk.0hRt3F.qrTVtYQ4bAKUVIrqDscf52Af1DZn9.s nPKufI91FhsAGbD3lEMpbdFqrEGzFNnXZyozrZmFcRqojdqO57W3kRM.Hipo uvW1fUnDucvDDI1RALzZhhs+ChhZGJMDtReetUUndSp1xfmAhOjYOds6aqwu vd4jb3Bl3fG5BxNCf8GOWmKMGo84gdOjvbDo5ZKzUTw7VXBd.kjbjwksNJ0j ZywnKoBUNUy.Kd.nnElJSpie4aTzP7O3DWbCN9Uv+FippJYYfuKyqLD3fTWF 1qzDw8DLLwQC+nwmFGTHzKKAA5fPnM9.G83yYqNjgEEetvL9ViLv3dwmj5wA IA+OVwElzGjDjXsLg1ZswnIvxXdSk.X.BFLVdGjeu7NtWq4o20IJbOj5eLyC B1Ol3p2fctmvQ28nDzkpER8JPiapG.6iiXamTnAPJTh84Rw3il6oMRYjBieK aE3Z5MLy0KZzRa3Aj1fIt2wweBrVLQ1do067o5nfA7TKHxlxRviNJrea9gNh sSOCY.bJzBnPznGwn2xJoyqAExm.JKTiFtBGRIInaCMfAGMeE6gLZ5p8EgZ9 wi6Z2FBg1ZBAtZBAj0+1w6ytoY2PoWuUe1SV8.u5hQIqJSWeiX8G7CZbByXJ MWP0bonwrPuZVK3YYLwKtlK3YKkbg9Ik.trcF2YwU+0j6Wb3oQb06TYGDGdR DW8aPuewU+oG.33eakzYwMAjKtSAhfoIP32IwglFwg5j3fSi3vejqy0shv9S ScttQNxGYwE8QNPjLXwU2go4unbhzvA -----------end_max5_patcher-----------
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 really doesn’t want to work on my system. It doesn’t recognize the version of fftw3.dll that I have.
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…)