fix
This commit is contained in:
18
src/main.cpp
18
src/main.cpp
@ -27,6 +27,8 @@
|
||||
#endif
|
||||
|
||||
#include "glext.h"
|
||||
#include "fft.h"
|
||||
|
||||
#pragma data_seg(".shader")
|
||||
#include "shaders/fragment.inl"
|
||||
#if POST_PASS
|
||||
@ -34,18 +36,12 @@
|
||||
#include "shaders/post.inl"
|
||||
#endif
|
||||
|
||||
#include "fft.h"
|
||||
|
||||
|
||||
#pragma data_seg(".pids")
|
||||
// static allocation saves a few bytes
|
||||
static int pidMain;
|
||||
static int pidPost;
|
||||
// static HDC hDC;
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef EDITOR_CONTROLS
|
||||
#pragma code_seg(".main")
|
||||
// FFT buffers
|
||||
@ -234,11 +230,11 @@ int __cdecl main(int argc, char* argv[])
|
||||
// Normalize output
|
||||
for (int i = 0; i < (FFT_SIZE / 4); i++)
|
||||
{
|
||||
float gain = 0.025f;
|
||||
float alpha = 0.15f; // "Hidastaa" FFT:n piikkejä
|
||||
float threshhold = 0.015f; // Alin arvo mik<69> p<><70>stet<65><74>n shaderille (v<>hent<6E><74> "noisea")
|
||||
float magnitude = sqrt(signal[i].re * signal[i].re + signal[i].im * signal[i].im);
|
||||
|
||||
float gain = 0.05f;
|
||||
float alpha = 0.10f; // "Hidastaa" FFT:n piikkejä
|
||||
float threshhold = 0.00015f; // Alin arvo mik<69> p<><70>stet<65><74>n shaderille (v<>hent<6E><74> "noisea")
|
||||
// float magnitude = sqrt(signal[i].re * signal[i].re + signal[i].im * signal[i].im); // signal strength
|
||||
float magnitude = (float)signal[i].re;
|
||||
float x_t = (magnitude < threshhold) ? 0.f : magnitude * gain;
|
||||
// Exponential smoothing kaava
|
||||
// s(t) = alpha*x(t)+(1-alpha)*s(t-1)
|
||||
|
||||
Reference in New Issue
Block a user