Commits on Source (3)
-
This function is just a scaling operation that passes a value between 0 and FFT_SCALING_VALUE to a value between 0 and 2^16-1. It is therefore a power that must be applied here and not a xor. Moreover, the initial formula was quite wrong since it was assuming that the max_input value, which is a signed int 16, was 2^15 = 32768 where it is in fact 2^15-1=32767. Moreover, the initial formula wasn't taking into account that, since the output of the fft_perform is the sum of two variables which have for max value (FFT_BUFFER_SIZE / 2 * INT16_MAX)^2, then we need to multiply the final max value by 2. Corrects the following compiler warnings: visualization/glspectrum.c:528:43: warning: result of ‘2^16’ is 18; did you mean ‘1 << 16’ (65536)? [-Wxor-used-as-pow] visualization/visual/effects.c:216:40: warning: result of ‘2^16’ is 18; did you mean ‘1 << 16’ (65536)? [-Wxor-used-as-pow] Fixes #28506 Co-authored-by:
Disha Baghel <bagheldisha708@gmail.com>
77a08a60 -
p_dest is used to set the height of the column, and it is used as a variable defined from zero to 2^16 - 1. It is therefore considered in the rest of the program as an unsigned int 16. Moreover, the value that we put inside are a sum of two squared real value, so they are necessarily positive.
94a8d152 -
In some cases, Y which represents the height of a column was equal to 1 and therefore when passed through the log, the output displayed was zero, by adding this 0.1, this allows you to see a column when y = 1 without really changing the height of each column
c347fed9
Showing