Example #1
0
void COFDMDemodulation::InitInternal(CParameter& ReceiverParam)
{
	iDFTSize = ReceiverParam.iFFTSizeN;
	iGuardSize = ReceiverParam.iGuardSize;
	iShiftedKmin = ReceiverParam.iShiftedKmin;
	iShiftedKmax = ReceiverParam.iShiftedKmax;

	/* Init plans for FFT (faster processing of Fft and Ifft commands) */
	FftPlan.Init(iDFTSize);

	/* Allocate memory for intermediate result of fftw */
	veccFFTInput.Init(iDFTSize);
	veccFFTOutput.Init(iDFTSize);

	/* Vector for power density spectrum of input signal */
	iLenPowSpec = iDFTSize / 2;
	vecrPowSpec.Init(iLenPowSpec, (_REAL) 0.0);
	rLamPSD = IIR1Lam(TICONST_PSD_EST_OFDM, (CReal) SOUNDCRD_SAMPLE_RATE /
		ReceiverParam.iSymbolBlockSize); /* Lambda for IIR filter */


	/* Define block-sizes for input and output */
	iInputBlockSize = iDFTSize;
	iOutputBlockSize = ReceiverParam.iNumCarrier;
}
Example #2
0
void CAGC::SetType(const EType eNewType)
{
	/* Set internal parameter */
	eType = eNewType;

	/*          Slow     Medium   Fast    */
	/* Attack: 0.025 s, 0.015 s, 0.005 s  */
	/* Decay : 4.000 s, 2.000 s, 0.200 s  */
	switch (eType)
	{
	case AT_SLOW:
		rAttack = IIR1Lam(0.025, SOUNDCRD_SAMPLE_RATE);
		rDecay = IIR1Lam(4.000, SOUNDCRD_SAMPLE_RATE);
		break;

	case AT_MEDIUM:
		rAttack = IIR1Lam(0.015, SOUNDCRD_SAMPLE_RATE);
		rDecay = IIR1Lam(2.000, SOUNDCRD_SAMPLE_RATE);
		break;

	case AT_FAST:
		rAttack = IIR1Lam(0.005, SOUNDCRD_SAMPLE_RATE);
		rDecay = IIR1Lam(0.200, SOUNDCRD_SAMPLE_RATE);
		break;
	}
}
Example #3
0
void CNoiseReduction::Init(const int iNewBlockLen)
{
	iBlockLen = iNewBlockLen;
	iHalfBlockLen = iBlockLen / 2;
	iBlockLenLong = 2 * iBlockLen;

	/* Block length of signal in frequency domain. "+ 1" because of the Nyquist
	   frequency */
	iFreqBlLen = iBlockLen + 1;

	/* Length of the minimum statistic history */
	iMinStatHistLen = (int) (MIN_STAT_HIST_LENGTH_SEC *
		(CReal) SOUNDCRD_SAMPLE_RATE / iBlockLen);

	/* Lambda for IIR filter */
	rLamPSD = IIR1Lam(TICONST_PSD_EST_SIG_NOISE_RED,
		(CReal) SOUNDCRD_SAMPLE_RATE / iBlockLen);

	/* Init vectors storing time series signals */
	vecrOldSignal.Init(iBlockLen, (CReal) 0.0);
	vecrVeryOldSignal.Init(iBlockLen, (CReal) 0.0);
	vecrFiltResult.Init(iBlockLen);
	vecrOutSig1.Init(iBlockLen);
	vecrLongSignal.Init(iBlockLenLong);
	vecrOptFiltTime.Init(iBlockLenLong);
	vecrOldOutSignal.Init(iHalfBlockLen, (CReal) 0.0);

	/* Init plans for FFT (faster processing of Fft and Ifft commands). FFT
	   plans are initialized with the long length */
	FftPlan.Init(iBlockLenLong);

	/* Init vectors storing data in frequency domain */
	veccOptFilt.Init(iFreqBlLen);

	/* Init signal and noise PDS estimation vectors */
	veccSigFreq.Init(iFreqBlLen);
	vecrSqMagSigFreq.Init(iFreqBlLen);
	vecrSigPSD.Init(iFreqBlLen, (CReal) 0.0);
	vecrNoisePSD.Init(iFreqBlLen, (CReal) 0.0);

	matrMinimumStatHist.Init(iFreqBlLen, iMinStatHistLen, (CReal) 0.0);

	/* Init window for overlap and add */
	vecrTriangWin.Init(iBlockLen);
	vecrTriangWin = Triang(iBlockLen);
}
Example #4
0
void CTimeSyncTrack::Init(CParameter& Parameter, int iNewSymbDelay)
{
  iNumCarrier = Parameter.iNumCarrier;    //ok?
  iScatPilFreqInt = Parameter.iScatPilFreqInt;  //ok?
  iNumIntpFreqPil = Parameter.iNumIntpFreqPil;  //ok?
  iDFTSize = Parameter.iFFTSizeN;   //ok?
  
  /* Timing correction history */
  iSymDelay = iNewSymbDelay;
  vecTiCorrHist.Init(iSymDelay, 0);
  
  /* History for new measurements (corrections) */
  veciNewMeasHist.Init(iSymDelay - 1, 0);
  
  /* Init vector for received data at pilot positions */
  veccPilots.Init(iNumIntpFreqPil);
  
  /* Vector for averaged power delay spread estimation */
  //vecrAvPoDeSp.Init(iNumIntpFreqPil, (CReal) 0.0);
  vecrAvPoDeSp.Init(iNumIntpFreqPil, 0);
  
  /* Lambda for IIR filter for averaging the PDS */
  rLamAvPDS = IIR1Lam(TICONST_PDS_EST_TISYNC, SOUNDCRD_SAMPLE_RATE /
		      Parameter.iSymbolBlockSize);  //changed CReal to CFReal here
  
  /* Vector for rotated result */
  vecrAvPoDeSpRot.Init(iNumIntpFreqPil);
  
  /* Length of guard-interval with respect to FFT-size! */
  rGuardSizeFFT = (CReal) iNumCarrier *
    Parameter.RatioTgTu.iEnum / Parameter.RatioTgTu.iDenom;
  
  /* Get the hamming window taps. The window is to reduce the leakage effect
     of a DFT transformation */
  vecrHammingWindow.Init(iNumIntpFreqPil);
  vecrHammingWindow = Hamming(iNumIntpFreqPil);
  
  /* Weights for peak bound calculation, in Eq. (19), special values for
     robustness mode D! */
  if (Parameter.GetWaveMode() == RM_ROBUSTNESS_MODE_D)
    {
      //rConst1 = pow(10, (_REAL) -TETA1_DIST_FROM_MAX_DB_RMD / 10);
      //rConst2 = pow(10, (_REAL) TETA2_DIST_FROM_MIN_DB_RMD / 10);
      rConst1 = pow(10, (FXP) -TETA1_DIST_FROM_MAX_DB_RMD / 10);
      rConst2 = pow(10, (FXP) TETA2_DIST_FROM_MIN_DB_RMD / 10);
    }
  else
    {
      //rConst1 = pow(10, (_REAL) -TETA1_DIST_FROM_MAX_DB / 10);
      //rConst2 = pow(10, (_REAL) TETA2_DIST_FROM_MIN_DB / 10);
      rConst1 = pow(10, (FXP) -TETA1_DIST_FROM_MAX_DB / 10);
      rConst2 = pow(10, (FXP) TETA2_DIST_FROM_MIN_DB / 10);
    }
  
  /* Define start point for rotation of detection vector for acausal taps.
     Per definition is this point somewhere in the region after the
     actual guard-interval window */
  if ((int) rGuardSizeFFT > iNumIntpFreqPil)
    iStPoRot = iNumIntpFreqPil;
  else
    {
      /* "+ 1" because of "Matlab indices" used in ".Merge()" function */
      iStPoRot = (int) (rGuardSizeFFT +
			Ceil((iNumIntpFreqPil - rGuardSizeFFT) / 2) + 1);
    }
  
  /* Init fractional part of timing correction to zero and fractional part
     of controlling */
  rFracPartTiCor_fxp = 0;
  rFracPartContr_fxp = 0;
  
  /* Inits for the time synchronization tracking type */
  SetTiSyncTracType(TypeTiSyncTrac);
  
  /* Init begin and end of PDS estimation with zero and the length of guard-
     interval respectively */
  rEstPDSBegin_fxp = 0;
  rEstPDSEnd_fxp = rGuardSizeFFT;
  
  /* Init plans for FFT (faster processing of Fft and Ifft commands) */
  FftPlan.Init(iNumIntpFreqPil);
  
  
  /* Inits for sample rate offset estimation ------------------------------ */
  /* Calculate number of symbols for a given time span as defined for the
     length of the sample rate offset estimation history size */
  iLenCorrectionHist = (int) ((_REAL) SOUNDCRD_SAMPLE_RATE *
			      HIST_LEN_SAM_OFF_EST_TI_CORR / Parameter.iSymbolBlockSize);
  
  /* Init count for acquisition */
  iResOffAcqCntMax = (int) ((_REAL) SOUNDCRD_SAMPLE_RATE *
			    SAM_OFF_EST_TI_CORR_ACQ_LEN / Parameter.iSymbolBlockSize);
  
  /* Init sample rate offset estimation acquisition count */
  iResOffsetAcquCnt = iResOffAcqCntMax;
  
  veciSRTiCorrHist.Init(iLenCorrectionHist, 0); /* Init with zeros */
  iIntegTiCorrections = 0;
  
  /* Symbol block size converted in domain of estimated PDS */
  rSymBloSiIRDomain = (CFReal) Parameter.iSymbolBlockSize * iNumCarrier / iDFTSize;
  /* changed from CReal to CFReal here */
  
  /* Init variable for storing the old difference of maximum position */
  iOldNonZeroDiff = 0;
}
Example #5
0
int CTimeWiener::Init(CParameter& ReceiverParam)
{
	int		iNoPiFreqDirAll;
	int		iSymDelyChanEst;
	int		iNumPilOneOFDMSym;
	int		iNumIntpFreqPil;
	_REAL	rSNR;

	/* Init base class, must be at the beginning of this init! */
	CPilotModiClass::InitRot(ReceiverParam);

	/* Set local parameters */
	iNumCarrier = ReceiverParam.iNumCarrier;
	iScatPilTimeInt = ReceiverParam.iScatPilTimeInt;
	iScatPilFreqInt = ReceiverParam.iScatPilFreqInt;
	iNumSymPerFrame = ReceiverParam.iNumSymPerFrame;
	iNumIntpFreqPil = ReceiverParam.iNumIntpFreqPil;

	/* We have to consider the last pilot at the end of the symbol ("+ 1") */
	iNoPiFreqDirAll = iNumCarrier / iScatPilFreqInt + 1;

	/* Init length of filter and maximum value of sigma (doppler) */
	switch (ReceiverParam.GetWaveMode())
	{
	case RM_ROBUSTNESS_MODE_A:
		iLengthWiener = LEN_WIENER_FILT_TIME_RMA;
		rSigmaMax = MAX_SIGMA_RMA;
		break;

	case RM_ROBUSTNESS_MODE_B:
		iLengthWiener = LEN_WIENER_FILT_TIME_RMB;
		rSigmaMax = MAX_SIGMA_RMB;
		break;

	case RM_ROBUSTNESS_MODE_E:
		iLengthWiener = LEN_WIENER_FILT_TIME_RME;
		rSigmaMax = MAX_SIGMA_RME;
		break;
	}

	/* Set delay of this channel estimation type. The longer the delay is, the
	   more "acausal" pilots can be used for interpolation. We use the same
	   amount of causal and acausal filter taps here */
	iSymDelyChanEst = (iLengthWiener / 2) * iScatPilTimeInt - 1;

	/* Set number of phases for wiener filter */
	iNoFiltPhasTi = iScatPilTimeInt;

	/* Set length of history-buffer */
	iLenHistBuff = iSymDelyChanEst + 1;

	/* Duration of useful part plus-guard interval */
	Ts = (_REAL) ReceiverParam.iSymbolBlockSize / SOUNDCRD_SAMPLE_RATE;

	/* Allocate memory for Channel at pilot positions (matrix) and init with
	   ones */
	matcChanAtPilPos.Init(iLengthWiener, iNoPiFreqDirAll,
		_COMPLEX((_REAL) 1.0, (_REAL) 0.0));

	/* Set number of taps for sigma estimation */
	if (iLengthWiener < NO_TAPS_USED4SIGMA_EST)
		iNumTapsSigEst = iLengthWiener;
	else
		iNumTapsSigEst = NO_TAPS_USED4SIGMA_EST;

	/* Init vector for estimation of the correlation function in time direction
	   (IIR average) */
	veccTiCorrEst.Init(iNumTapsSigEst, (CReal) 0.0);

	/* Init time constant for IIR filter for averaging correlation estimation.
	   Consider averaging over frequency axis, too. Pilots in frequency
	   direction are "iScatPilTimeInt * iScatPilFreqInt" apart */
	iNumPilOneOFDMSym = iNumIntpFreqPil / iScatPilTimeInt;
	rLamTiCorrAv = IIR1Lam(TICONST_TI_CORREL_EST * iNumPilOneOFDMSym,
		(CReal) SOUNDCRD_SAMPLE_RATE / ReceiverParam.iSymbolBlockSize);

	/* Init Update counter for wiener filter update. We immediatly use the
	   filtered result although right at the beginning there is no averaging.
	   But sine the estimation usually starts with bigger values and goes down
	   to the correct one, this should be not critical */
	iUpCntWienFilt = iNumSymPerFrame;

	/* Init averaging of SNR values */
	rAvSNR = (_REAL) 0.0;
	iAvSNRCnt = 0;


	/* Allocate memory for filter phases (Matrix) */
	matrFiltTime.Init(iNoFiltPhasTi, iLengthWiener);

	/* Length of the timing correction history buffer */
	iLenTiCorrHist = iLengthWiener * iNoFiltPhasTi;

	/* Init timing correction history with zeros */
	vecTiCorrHist.Init(iLenTiCorrHist, 0);

	/* Get the index of first symbol in a super-frame on where the first cell
	   (carrier-index = 0) is a pilot. This is needed for determining the
	   correct filter phase for the convolution */
	iFirstSymbWithPi = 0;
	while (!_IsScatPil(ReceiverParam.matiMapTab[iFirstSymbWithPi][0]))
		iFirstSymbWithPi++;


	/* Calculate optimal filter --------------------------------------------- */
	/* Distinguish between simulation and regular receiver. When we run a
	   simulation, the parameters are taken from simulation init */
	{
		/* Init SNR value */
		rSNR = pow(10, INIT_VALUE_SNR_WIEN_TIME_DB / 10);

		/* Init sigma with a very large value. This make the acquisition more
		   robust in case of a large sample frequency offset. But we get more
		   aliasing in the time domain and this could make the timing unit
		   perform worse. Therefore, this is only a trade-off */
		rSigma = rSigmaMax * 4;
	}

	/* Calculate initialization wiener filter taps and init MMSE */
	rMMSE = UpdateFilterCoef(rSNR, rSigma);

	/* Return delay of channel equalization */
	return iLenHistBuff;
}
Example #6
0
void CSyncUsingPil::InitInternal(CParameter& ReceiverParam)
{
	int			i;
	_COMPLEX	cPhaseCorTermDivi;

	/* Init base class for modifying the pilots (rotation) */
	CPilotModiClass::InitRot(ReceiverParam);

	/* Init internal parameters from global struct */
	iNumCarrier = ReceiverParam.iNumCarrier;
	eCurRobMode = ReceiverParam.GetWaveMode();

	/* Check if symbol number per frame has changed. If yes, reset the
	   symbol counter */
	if (iNumSymPerFrame != ReceiverParam.iNumSymPerFrame)
	{
		/* Init internal counter for symbol number */
		iSymbCntFraSy = 0;

		/* Refresh parameter */
		iNumSymPerFrame = ReceiverParam.iNumSymPerFrame;
	}

	/* Allocate memory for histories. Init history with small values, because
	   we search for maximum! */
	vecrCorrHistory.Init(iNumSymPerFrame, -_MAXREAL);

	/* Set middle of observation interval */
	iMiddleOfInterval = iNumSymPerFrame / 2;


#ifdef USE_DRM_FRAME_SYNC_IR_BASED
	/* DRM frame synchronization using impulse response, inits--------------- */
	/* Get number of pilots in first symbol of a DRM frame */
	iNumPilInFirstSym = 0;
	for (i = 0; i < iNumCarrier; i++)
	{
		if (_IsScatPil(ReceiverParam.matiMapTab[0][i]))
			iNumPilInFirstSym++;
	}

	/* Init vector for "test" channel estimation result */
	veccChan.Init(iNumPilInFirstSym);
	vecrTestImpResp.Init(iNumPilInFirstSym);

	/* Init plans for FFT (faster processing of Fft and Ifft commands) */
	FftPlan.Init(iNumPilInFirstSym);

#else

	/* DRM frame synchronization based on time pilots, inits ---------------- */
	/* Allocate memory for storing pilots and indices. Since we do
	   not know the resulting "iNumPilPairs" we allocate memory for the
	   worst case, i.e. "iNumCarrier" */
	vecPilCorr.Init(iNumCarrier);

	/* Store pilots and indices for calculating the correlation. Use only first
	   symbol of "matcPilotCells", because there are the pilots for
	   Frame-synchronization */
	iNumPilPairs = 0;

	for (i = 0; i < iNumCarrier - 1; i++)
	{
		/* Only successive pilots (in frequency direction) are used */
		if (_IsPilot(ReceiverParam.matiMapTab[0][i]) &&
			_IsPilot(ReceiverParam.matiMapTab[0][i + 1]))
		{
			/* Store indices and complex numbers */
			vecPilCorr[iNumPilPairs].iIdx1 = i;
			vecPilCorr[iNumPilPairs].iIdx2 = i + 1;
			vecPilCorr[iNumPilPairs].cPil1 = ReceiverParam.matcPilotCells[0][i];
			vecPilCorr[iNumPilPairs].cPil2 =
				ReceiverParam.matcPilotCells[0][i + 1];

			iNumPilPairs++;
		}
	}

	/* Calculate channel correlation in frequency direction. Use rectangular
	   shaped PDS with the length of the guard-interval */
	const CReal rArgSinc =
		(CReal) ReceiverParam.iGuardSize / ReceiverParam.iFFTSizeN;
	const CReal rArgExp = crPi * rArgSinc;

	cR_HH = Sinc(rArgSinc) * CComplex(Cos(rArgExp), -Sin(rArgExp));
#endif


	/* Frequency offset estimation ------------------------------------------ */
	/* Get position of frequency pilots */
	int iFreqPilCount = 0;
	int iAvPilPos = 0;
	for (i = 0; i < iNumCarrier - 1; i++)
	{
		if (_IsFreqPil(ReceiverParam.matiMapTab[0][i]))
		{
			/* For average frequency pilot position to DC carrier */
			iAvPilPos += i + ReceiverParam.iCarrierKmin;
			
			iPosFreqPil[iFreqPilCount] = i;
			iFreqPilCount++;
		}
	}

	/* Average distance of the frequency pilots from the DC carrier. Needed for
	   corrections for sample rate offset changes. Normalized to sample rate! */
	rAvFreqPilDistToDC =
		(CReal) iAvPilPos / NUM_FREQ_PILOTS / ReceiverParam.iFFTSizeN;

	/* Init memory for "old" frequency pilots */
	for (i = 0; i < NUM_FREQ_PILOTS; i++)
		cOldFreqPil[i] = CComplex((CReal) 0.0, (CReal) 0.0);
	
	/* Nomalization constant for frequency offset estimation */
	rNormConstFOE =
		(CReal) 1.0 / ((CReal) 2.0 * crPi * ReceiverParam.iSymbolBlockSize);

	/* Init time constant for IIR filter for frequency offset estimation */
	rLamFreqOff = IIR1Lam(TICONST_FREQ_OFF_EST, (CReal) SOUNDCRD_SAMPLE_RATE /
		ReceiverParam.iSymbolBlockSize);

	/* Init vector for averaging the frequency offset estimation */
	cFreqOffVec = CComplex((CReal) 0.0, (CReal) 0.0);

	/* Init value for previous estimated sample rate offset with the current
	   setting. This can be non-zero if, e.g., an initial sample rate offset
	   was set by command line arguments */
	rPrevSamRateOffset = ReceiverParam.rResampleOffset;


#ifdef USE_SAMOFFS_TRACK_FRE_PIL
	/* Inits for sample rate offset estimation algorithm -------------------- */
	/* Init memory for actual phase differences */
	for (i = 0; i < NUM_FREQ_PILOTS; i++)
		cFreqPilotPhDiff[i] = CComplex((CReal) 0.0, (CReal) 0.0);

	/* Init time constant for IIR filter for sample rate offset estimation */
	rLamSamRaOff = IIR1Lam(TICONST_SAMRATE_OFF_EST,
		(CReal) SOUNDCRD_SAMPLE_RATE / ReceiverParam.iSymbolBlockSize);
#endif


	/* Define block-sizes for input and output */
	iInputBlockSize = iNumCarrier;
	iMaxOutputBlockSize = iNumCarrier;
}
void CChannelEstimation::InitInternal(CParameter& ReceiverParam)
{
	/* Get parameters from global struct */
	iScatPilTimeInt = ReceiverParam.iScatPilTimeInt;
	iScatPilFreqInt = ReceiverParam.iScatPilFreqInt;
	iNumIntpFreqPil = ReceiverParam.iNumIntpFreqPil;
	iNumCarrier = ReceiverParam.iNumCarrier;
	iFFTSizeN = ReceiverParam.iFFTSizeN;
	iNumSymPerFrame = ReceiverParam.iNumSymPerFrame;

	/* Length of guard-interval with respect to FFT-size! */
	rGuardSizeFFT = (_REAL) iNumCarrier *
		ReceiverParam.RatioTgTu.iEnum / ReceiverParam.RatioTgTu.iDenom;

	/* If robustness mode D is active, get DC position. This position cannot
	   be "0" since in mode D no 5 kHz mode is defined (see DRM-standard). 
	   Therefore we can also use this variable to get information whether
	   mode D is active or not (by simply write: "if (iDCPos != 0)") */
	iDCPos = 0;

	/* FFT must be longer than "iNumCarrier" because of zero padding effect (
	   not in robustness mode D! -> "iLongLenFreq = iNumCarrier") */
	iLongLenFreq = iNumCarrier + iScatPilFreqInt - 1;

	/* Init vector for received data at pilot positions */
	veccPilots.Init(iNumIntpFreqPil);

	/* Init vector for interpolated pilots */
	veccIntPil.Init(iLongLenFreq);

	/* Init plans for FFT (faster processing of Fft and Ifft commands) */
	FftPlanShort.Init(iNumIntpFreqPil);
	FftPlanLong.Init(iLongLenFreq);

	/* Choose time interpolation method and set pointer to correcponding 
	   object */
	switch (TypeIntTime)
	{
	case TLINEAR:
		pTimeInt = &TimeLinear;
		break;

	case TWIENER:
		pTimeInt = &TimeWiener;
		break;
	}

	/* Init time interpolation interface and set delay for interpolation */
	iLenHistBuff = pTimeInt->Init(ReceiverParam);

	/* Init time synchronization tracking unit */
	TimeSyncTrack.Init(ReceiverParam, iLenHistBuff);

	/* Set channel estimation delay in global struct. This is needed for 
	   simulation */
	ReceiverParam.iChanEstDelay = iLenHistBuff;


	/* Init window for DFT operation for frequency interpolation ------------ */
	/* Init memory */
	vecrDFTWindow.Init(iNumIntpFreqPil);
	vecrDFTwindowInv.Init(iNumCarrier);

	/* Set window coefficients */
	switch (eDFTWindowingMethod)
	{
	case DFT_WIN_RECT:
		vecrDFTWindow = Ones(iNumIntpFreqPil);
		vecrDFTwindowInv = Ones(iNumCarrier);
		break;

	case DFT_WIN_HAMM:
		vecrDFTWindow = Hamming(iNumIntpFreqPil);
		vecrDFTwindowInv = (CReal) 1.0 / Hamming(iNumCarrier);
		break;
	}


	/* Set start index for zero padding in time domain for DFT method */
	iStartZeroPadding = (int) rGuardSizeFFT;
	if (iStartZeroPadding > iNumIntpFreqPil)
		iStartZeroPadding = iNumIntpFreqPil;

	/* Allocate memory for channel estimation */
	veccChanEst.Init(iNumCarrier);

	/* Allocate memory for history buffer (Matrix) and zero out */
	matcHistory.Init(iLenHistBuff, iNumCarrier,
		_COMPLEX((_REAL) 0.0, (_REAL) 0.0));

	/* After an initialization we do not put out data befor the number symbols
	   of the channel estimation delay have been processed */
	iInitCnt = iLenHistBuff - 1;

	/* Inits for SNR estimation (noise and signal averages) */
	rSNREstimate = (_REAL) pow(10.0, INIT_VALUE_SNR_ESTIM_DB / 10);
	rSignalEst = (_REAL) 0.0;
	rNoiseEst = (_REAL) 0.0;

	/* For SNR estimation initialization */
	iNumCellsSNRInit = iNumSymPerFrame * iNumCarrier; /* 1 DRM frame */
	iSNREstInitCnt = iNumCellsSNRInit;
	bWasSNRInit = TRUE;

	/* Lambda for IIR filter */
	rLamSNREstFast = IIR1Lam(TICONST_SNREST_FAST, (CReal) SOUNDCRD_SAMPLE_RATE /
		ReceiverParam.iSymbolBlockSize);
	rLamSNREstSlow = IIR1Lam(TICONST_SNREST_SLOW, (CReal) SOUNDCRD_SAMPLE_RATE /
		ReceiverParam.iSymbolBlockSize);


	/* SNR correction factor. We need this factor since we evalute the 
	   signal-to-noise ratio only on the pilots and these have a higher power as
	   the other cells */
	rSNRCorrectFact = 
		ReceiverParam.rAvPilPowPerSym /	ReceiverParam.rAvPowPerSymbol;

	/* Init delay spread length estimation (index) */
	rLenPDSEst = (_REAL) 0.0;

	/* Init maximum estimated delay spread and offset in one DRM frame */
	rMaxLenPDSInFra = (_REAL) 0.0;
	rMinOffsPDSInFra = rGuardSizeFFT;

	/* Inits for Wiener interpolation in frequency direction ---------------- */
	/* Length of wiener filter */
	switch (ReceiverParam.GetWaveMode())
	{
	case RM_ROBUSTNESS_MODE_A:
		iLengthWiener = LEN_WIENER_FILT_FREQ_RMA;
		break;

	case RM_ROBUSTNESS_MODE_B:
		iLengthWiener = LEN_WIENER_FILT_FREQ_RMB;
		break;

	case RM_ROBUSTNESS_MODE_E:
		iLengthWiener = LEN_WIENER_FILT_FREQ_RME;
		break;
	}


	/* Inits for wiener filter ---------------------------------------------- */
	/* In frequency direction we can use pilots from both sides for 
	   interpolation */
	iPilOffset = iLengthWiener / 2;

	/* Allocate memory */
	matcFiltFreq.Init(iNumCarrier, iLengthWiener);

	/* Pilot offset table */
	veciPilOffTab.Init(iNumCarrier);

	/* Number of different wiener filters */
	iNoWienerFilt = (iLengthWiener - 1) * iScatPilFreqInt + 1;

	/* Allocate temporary matlib vector for filter coefficients */
	matcWienerFilter.Init(iNoWienerFilt, iLengthWiener);

#ifdef UPD_WIENER_FREQ_EACH_DRM_FRAME
	/* Init Update counter for wiener filter update */
	iUpCntWienFilt = iNumSymPerFrame;
#endif

	/* Initial Wiener filter. Use initial SNR definition and assume that the
	   PDS ranges from the beginning of the guard-intervall to the end */
	UpdateWienerFiltCoef(pow(10.0, INIT_VALUE_SNR_WIEN_FREQ_DB / 10),
		(_REAL) ReceiverParam.RatioTgTu.iEnum / 
		ReceiverParam.RatioTgTu.iDenom, (CReal) 0.0);


	/* Define block-sizes for input and output */
	iInputBlockSize = iNumCarrier;
	iMaxOutputBlockSize = iNumCarrier; 
}