|
@@ -209,6 +209,8 @@ void _cmGoldSigModulate( cmGoldSig_t* p, unsigned chIdx )
|
209
|
209
|
cmGoldSig_t* cmGoldSigAlloc( cmCtx* ctx, cmGoldSig_t* p, const cmGoldSigArg_t* a )
|
210
|
210
|
{
|
211
|
211
|
cmGoldSig_t* op = cmObjAlloc(cmGoldSig_t,ctx,p);
|
|
212
|
+
|
|
213
|
+ p->fir = cmFIRAllocKaiser(ctx, NULL, 0, 0, 0, 0, 0, 0, 0 );
|
212
|
214
|
|
213
|
215
|
if( a != NULL )
|
214
|
216
|
if( cmGoldSigInit(op,a) != cmOkRC )
|
|
@@ -236,7 +238,8 @@ cmRC_t cmGoldSigFree( cmGoldSig_t** pp )
|
236
|
238
|
cmMemFree(p->ch[i].bbV);
|
237
|
239
|
cmMemFree(p->ch[i].mdV);
|
238
|
240
|
}
|
239
|
|
-
|
|
241
|
+
|
|
242
|
+ cmFIRFree(&p->fir);
|
240
|
243
|
cmMemFree(p->ch);
|
241
|
244
|
cmMemFree(p->rcosV);
|
242
|
245
|
cmMemFree(p->pnM);
|
|
@@ -270,6 +273,27 @@ cmRC_t cmGoldSigInit( cmGoldSig_t* p, const cmGoldSigArg_t* a )
|
270
|
273
|
// generate the rcos impulse response
|
271
|
274
|
_cmGoldSigRaisedCos(p->rcosV,p->rcosN,a->samplesPerChip,a->rcosBeta);
|
272
|
275
|
|
|
276
|
+ if(1)
|
|
277
|
+ {
|
|
278
|
+ double passHz = 20000.0;
|
|
279
|
+ double stopHz = 17000.0;
|
|
280
|
+ double passDb = 1.0;
|
|
281
|
+ double stopDb = 90.0;
|
|
282
|
+ unsigned flags = 0;
|
|
283
|
+
|
|
284
|
+ if( cmFIRInitKaiser(p->fir, 64, a->srate, passHz, stopHz, passDb, stopDb, flags ) != cmOkRC )
|
|
285
|
+ {
|
|
286
|
+ rc = cmCtxRtCondition(&p->obj,cmSubSysFailRC,"Unable to allocate internal FIR.");
|
|
287
|
+ goto errLabel;
|
|
288
|
+ }
|
|
289
|
+
|
|
290
|
+ p->rcosN = p->fir->coeffCnt;
|
|
291
|
+ p->rcosV = cmMemResizeZ(cmSample_t,p->rcosV,p->rcosN);
|
|
292
|
+ cmVOS_CopyD(p->rcosV,p->rcosN,p->fir->coeffV);
|
|
293
|
+
|
|
294
|
+ }
|
|
295
|
+
|
|
296
|
+
|
273
|
297
|
// for each channel
|
274
|
298
|
for(i=0; i<a->chN; ++i)
|
275
|
299
|
{
|
|
@@ -294,7 +318,7 @@ cmRC_t cmGoldSigInit( cmGoldSig_t* p, const cmGoldSigArg_t* a )
|
294
|
318
|
}
|
295
|
319
|
|
296
|
320
|
cmRC_t cmGoldSigFinal( cmGoldSig_t* p )
|
297
|
|
-{ return cmOkRC; }
|
|
321
|
+{ return cmFIRFinal(p->fir); }
|
298
|
322
|
|
299
|
323
|
cmRC_t cmGoldSigWrite( cmCtx* ctx, cmGoldSig_t* p, const char* fn )
|
300
|
324
|
{
|