I don't know if this is even possible to do, but thought I would ask, I suspect that if it is possible, it would be changed in the - (void) renderFFTToTex routine. Does anybody have any ideas about doing this or other suggestions that they could recommend? Thank you.
A:
To rescale the frequency, we need to scale this parameter:
CGFloat yFract = (CGFloat)y / (CGFloat)(maxY - 1);
which has a value between 0..1, and determines which fft output to take to display on display line y.
To get a logarithmic scale, first do the math: a frequency f (0.1kHz-20kHz) must be displayed on a position log(f). Call the low bound (0.1kHz) L, the high bound (20kHz) H. Then after some math [[skipped]] you get:
yFract = ( exp(yFract*log(H/L)) - 1 ) / ( H/L - 1 );
where you should fill in what you think is the H/L ratio, e.g.
yFract = ( exp(yFract*log(20)) - 1 ) / ( 20 - 1 );
(you should check if 0 gives 0 and 1 gives 1, which is the case)
mvds
2010-08-04 23:05:23
The data still seems really crowded on the lower end of the frequency band.
Ian Oswald
2010-08-04 23:44:46
Nevermind, I had to modify it in both places that yFract is being used. Thanks a bunch for your help and answer.
Ian Oswald
2010-08-04 23:48:10
What was that formula that you used for scaling the dB level again?
Ian Oswald
2010-08-05 15:38:02
You can use the same logic, on `interpVal`, after the sqrt. The determining factor is again the H/L ratio.
mvds
2010-08-05 18:01:25