tags:

views:

33

answers:

1

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
The data still seems really crowded on the lower end of the frequency band.
Ian Oswald
Nevermind, I had to modify it in both places that yFract is being used. Thanks a bunch for your help and answer.
Ian Oswald
What was that formula that you used for scaling the dB level again?
Ian Oswald
You can use the same logic, on `interpVal`, after the sqrt. The determining factor is again the H/L ratio.
mvds