mirror of
https://github.com/mborgerding/kissfft.git
synced 2026-02-21 22:42:56 -05:00
additional features for peak picking
This commit is contained in:
35
tones.c
Normal file
35
tones.c
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <memory.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "kiss_fft.h"
|
||||
|
||||
#define PI 3.14159
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
int k;
|
||||
float fs=44100;
|
||||
|
||||
float fr=1,fl=300;
|
||||
|
||||
float th[2] = {0,0};
|
||||
float thinc[2] = {2*PI*fr/fs,2*PI*fl/fs };
|
||||
|
||||
while (1){
|
||||
for (k=0;k<2;++k){
|
||||
short s;
|
||||
th[k] += thinc[k];
|
||||
if (th[k] > 2*PI){
|
||||
th[k] -= 2*PI;
|
||||
}
|
||||
s=(short)32767*cos( th[k] );
|
||||
fwrite(&s,sizeof(s),1,stdout);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user