mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-07-30 08:19:14 +02:00
oh
This commit is contained in:
@@ -1,12 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <math.h>
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
#endif
|
#endif
|
||||||
#ifndef M_2PI
|
#ifndef M_2PI
|
||||||
#define M_2PI (M_PI * 2.0)
|
#define M_2PI (M_PI * 2.0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline float sincf(float x) {
|
|
||||||
return (x == 0.0f) ? 1.0f : sinf(M_PI * x) / (M_PI * x);
|
|
||||||
}
|
|
||||||
@@ -14,6 +14,10 @@ float hard_clip(float sample, float threshold) {
|
|||||||
return fmaxf(-threshold, fminf(threshold, sample));
|
return fmaxf(-threshold, fminf(threshold, sample));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float sincf(float x) {
|
||||||
|
return (x == 0.0f) ? 1.0f : sinf(M_PI * x) / (M_PI * x);
|
||||||
|
}
|
||||||
|
|
||||||
void init_bpf(FIRFilter *bpf, float start, float end) {
|
void init_bpf(FIRFilter *bpf, float start, float end) {
|
||||||
int m = FILTER_LEN - 1;
|
int m = FILTER_LEN - 1;
|
||||||
float sum = 0.0f;
|
float sum = 0.0f;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <math.h>
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "oscillator.h"
|
#include "oscillator.h"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user