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