![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
for Danillo
Dependencies: MBed_Adafruit-GPS-Library SDFileSystem mbed
Diff: QAM.h
- Revision:
- 3:0cc40383d016
- Parent:
- 2:abcf77d0e77d
--- a/QAM.h Thu Dec 11 01:23:24 2014 +0000 +++ b/QAM.h Sat Jan 17 19:12:28 2015 +0000 @@ -28,7 +28,7 @@ int i, j; float out[SAMPLE_LENGTH] = {}; - for( i = 0; i < SAMPLE_LENGTH; i++ ) + for( i = NUM_TAPS; i < SAMPLE_LENGTH; i++ ) { out[ i ] = 0.0; for( j = 0; j < NUM_TAPS; j++ ){ @@ -57,12 +57,7 @@ return total/denom; } -float qam_in(float *samples, float *sI, float *sQ, Serial *pc){ - //print_array_serial(samples, SAMPLE_LENGTH, pc); - for(int i = 0; i < SAMPLE_LENGTH; i++){ - sI[i] = samples[i]*cos(2*PI*CARRIER_FREQ*i*TIME_CONST); - sQ[i] = -samples[i]*sin(2*PI*CARRIER_FREQ*i*TIME_CONST); - } +float qam_in(float *sI, float *sQ, Serial *pc){ filter(sI, pc); filter(sQ, pc); return avg_QAM(sI, sQ, SAMPLE_LENGTH);