![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
working wavelet transform
Dependencies: CMSIS_DSP_5 include mbed
Fork of Nucleo-Heart-Rate by
Diff: main.cpp
- Revision:
- 3:e44f3e92cb34
- Parent:
- 2:3d6a6b9afee0
- Child:
- 5:182ee08ee2b0
--- a/main.cpp Wed Jun 20 09:25:46 2018 +0000 +++ b/main.cpp Wed Jun 20 09:44:30 2018 +0000 @@ -10,30 +10,30 @@ Serial usb_serial(SERIAL_TX, SERIAL_RX); // tx, rx const int baud_rate = 115200; // Baud rate. -static float32_t cosSum[320]; - -float32_t *cosArray(int length, int freq, int fs){ - float *p = (float *) malloc(sizeof(float) * length); - double Ts = (double) 1/fs; - double w = 2*PI*freq; - - for(int i = 0; i < length; i++){ - p[i] = arm_cos_f32(w * Ts * i); - } - - return p; -} +//static float32_t cosSum[320]; +// +//float32_t *cosArray(int length, int freq, int fs){ +// float *p = (float *) malloc(sizeof(float) * length); +// double Ts = (double) 1/fs; +// double w = 2*PI*freq; +// +// for(int i = 0; i < length; i++){ +// p[i] = arm_cos_f32(w * Ts * i); +// } +// +// return p; +//} int main() { usb_serial.baud(baud_rate); // Set serial USB connection baud rate (variable is declared in config part). - uint32_t N = 320; - uint32_t fs = 100; - uint32_t freq1 = 1; - uint32_t freq2 = 12; - float32_t *testCos1 = cosArray(N, freq1, fs); - float32_t *testCos2 = cosArray(N, freq2, fs); + uint32_t N = 3000; + uint32_t fs = 160; +// uint32_t freq1 = 1; +// uint32_t freq2 = 12; +// float32_t *testCos1 = cosArray(N, freq1, fs); +// float32_t *testCos2 = cosArray(N, freq2, fs); wave_object obj; wt_object wt;