@@ -219,6 +219,8 @@ struct OFDM *ofdm_create(const struct OFDM_CONFIG *config) {
219219 ofdm -> clip_en = false;
220220 ofdm -> foff_limiter = false;
221221 ofdm -> data_mode = "" ;
222+ ofdm -> fmin = -50.0 ; /* frequency minimum for ofdm acquisition range */
223+ ofdm -> fmax = 50.0 ; /* frequency maximum for ofdm acquisition range */
222224 memset (ofdm -> tx_uw , 0 , ofdm -> nuwbits );
223225 } else {
224226 /* Use the users values */
@@ -252,6 +254,8 @@ struct OFDM *ofdm_create(const struct OFDM_CONFIG *config) {
252254 ofdm -> clip_en = config -> clip_en ;
253255 memcpy (ofdm -> tx_uw , config -> tx_uw , ofdm -> nuwbits );
254256 ofdm -> data_mode = config -> data_mode ;
257+ ofdm -> fmin = config -> fmin ; /* frequency minimum for ofdm acquisition range */
258+ ofdm -> fmax = config -> fmax ; /* frequency maximum for ofdm acquisition range */
255259
256260 }
257261
@@ -297,6 +301,9 @@ struct OFDM *ofdm_create(const struct OFDM_CONFIG *config) {
297301 ofdm -> config .clip_en = ofdm -> clip_en ;
298302 memcpy (ofdm -> config .tx_uw , ofdm -> tx_uw , ofdm -> nuwbits );
299303 ofdm -> config .data_mode = ofdm -> data_mode ;
304+ ofdm -> config .fmin = ofdm -> fmin ;
305+ ofdm -> config .fmax = ofdm -> fmax ;
306+
300307
301308 /* Calculate sizes from config param */
302309
@@ -421,6 +428,10 @@ struct OFDM *ofdm_create(const struct OFDM_CONFIG *config) {
421428 ofdm -> nin = ofdm -> samplesperframe ;
422429 ofdm -> mean_amp = 0.0f ;
423430 ofdm -> foff_metric = 0.0f ;
431+
432+ ofdm -> fmin = -50.0f ;
433+ ofdm -> fmax = 50.0f ;
434+
424435 /*
425436 * Unique Word symbol placement. Note we need to group the UW
426437 * bits so they fit into symbols. The LDPC decoder works on
@@ -1158,9 +1169,9 @@ static void burst_acquisition_detector(struct OFDM *ofdm,
11581169
11591170 float fmin , fmax , fstep ;
11601171 int tstep ;
1161-
1172+
11621173 // initial search over coarse grid
1163- tstep = 4 ; fstep = 5 ; fmin = -50.0 ; fmax = 50.0 ;
1174+ tstep = 4 ; fstep = 5 ; fmin = ofdm -> fmin ; fmax = ofdm -> fmax ;
11641175 * timing_mx = est_timing_and_freq (ofdm , ct_est , foff_est ,
11651176 & rx [n ], 2 * ofdm -> samplesperframe ,
11661177 known_sequence , ofdm -> samplesperframe ,
0 commit comments