Turhaksi jäänyt if ehto pois.
This commit is contained in:
23
src/main.cpp
23
src/main.cpp
@ -184,20 +184,15 @@ int __cdecl main(int argc, char* argv[])
|
|||||||
compute_fft(fft_input, fft_output);
|
compute_fft(fft_input, fft_output);
|
||||||
|
|
||||||
// Normalize output
|
// Normalize output
|
||||||
for (int i = 0; i < (FFT_SIZE / 2); i++)
|
for (int i = 0; i < (FFT_SIZE / 4); i++)
|
||||||
{
|
{
|
||||||
//maximum = max(fft_output[i], maximum);
|
float gain = 50.0f;
|
||||||
//fft_output[i] = fft_output[i] / maximum;
|
float alpha = 0.15f; // "Hidastaa" FFT:n piikkej<65>
|
||||||
if (i < (FFT_SIZE / 4)) // Limit uniform fft size. High frequencys contain nothing interesing.
|
float threshhold = 0.05f; // Alin arvo mik<69> p<><70>stet<65><74>n shaderille (v<>hent<6E><74> "noisea")
|
||||||
{
|
float x_t = fft_output[i] * gain;
|
||||||
float gain = 50.0f;
|
// Exponential smoothing kaava
|
||||||
float alpha = 0.15f; // "Hidastaa" FFT:n piikkej<65>
|
// s(t) = alpha*x(t)+(1-alpha)*s(t-1)
|
||||||
float threshhold = 0.05f; // Alin arvo mik<69> p<><70>stet<65><74>n shaderille (v<>hent<6E><74> "noisea")
|
fft_uniform[i] = (x_t < threshhold) ? 0.f : alpha*(x_t) + (1-alpha)*fft_uniform[i];
|
||||||
float x_t = fft_output[i] * gain;
|
|
||||||
// Exponential smoothing kaava
|
|
||||||
// s(t) = alpha*x(t)+(1-alpha)*s(t-1)
|
|
||||||
fft_uniform[i] = (x_t < threshhold) ? 0.f : alpha*(x_t) + (1-alpha)*fft_uniform[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
syncs[0] = (float)playCursor / (SU_SAMPLE_RATE * SU_CHANNEL_COUNT * SU_SAMPLE_SIZE); // Aika sekunteina.
|
syncs[0] = (float)playCursor / (SU_SAMPLE_RATE * SU_CHANNEL_COUNT * SU_SAMPLE_SIZE); // Aika sekunteina.
|
||||||
|
|||||||
Reference in New Issue
Block a user