1
$\begingroup$

Despite using the same channel for convolution, each time I get a different estimated channel. Could you please tell me what I'm doing wrong? I want to demonstrate that I can estimate the same channel for different modulated signals (dataIn). The code is:

Channel data moved here.. It comes from here.

M=4;
nfft  = 512; % Number of data carriers
% Generate random data
dataIn = randi([0 M-1],1,nfft,1);
% Apply QPSK modulation
qamSig = qammod(dataIn,M,'UnitAveragePower',true);
% Taking IFFT
x_ifft1 = sqrt(nfft) * ifft(fftshift(qamSig),nfft);
% transmit through the channel
yhat2 = conv(x_ifft1,channelTD.');
% set the signal power to '1'
yhat2 = yhat2 / sqrt(var(yhat2));
% Taking FFT  OFDM for the perfect channel knowledge
y_fft2 = (1/sqrt(nfft))*(fft(fftshift(yhat2),nfft));
% Estimate Channel
EstimatedChannel = y_fft2 ./ qamSig;

%channelTD(401x1)

%%%%%%%%%%%%%%%%%%%%%Updated Code%%%%%%%%%%%%%%%%%%%%%%%%%%
M=4;
nfft  =512; % Number of data carriers
CP=16; %% Cyclic Prefix Lenght

% Generate random data
dataIn = randi([0 M-1],1,nfft,1);

% Apply QPSK modulation
qamSig = qammod(dataIn,M,'UnitAveragePower',true);

% Taking IFFT
x_ifft1 = sqrt(nfft) * ifft(fftshift(qamSig),nfft);

% Adding Cyclic Prefix
SignalWithCyclicPrefix = x_ifft1(:, end-CP+1:end);
SignalWithCyclicPrefix = [SignalWithCyclicPrefix x_ifft1];

% transmit through the channel
yhat2 = conv(SignalWithCyclicPrefix,channelTD.');

% set the signal power to '1'
%yhat2 = yhat2 / sqrt(var(yhat2));

% Removing Cyclic Prefix
receivedSignal = yhat2(:,[CP+1:size(x_ifft1,2)+CP]);

% Taking FFT  OFDM for the perfect channel knowledge
y_fft2 = (1/sqrt(nfft))*(fft(fftshift(receivedSignal),nfft));

% Estimate Channel
EstimatedChannel = y_fft2 ./ qamSig;

$\endgroup$
3
  • $\begingroup$ Apologies for blowing away your edit. I didn't feel the channel data belonged in the question, so I moved it to a GitHub gist that I've linked to. $\endgroup$
    – Peter K.
    Jun 2 at 13:29
  • $\begingroup$ Thank you so much for your help! $\endgroup$
    – Zeynep
    Jun 2 at 13:40
  • 3
    $\begingroup$ You're welcome. Just trying to format your question so it's more likely to get an answer. Long questions tend to be avoided, particularly when they appear to be 90% code. $\endgroup$
    – Peter K.
    Jun 2 at 13:43

2 Answers 2

1
$\begingroup$
% set the signal power to '1'
yhat2 = yhat2 / sqrt(var(yhat2));

Here you're effectively acting as if the channel gain was different, depending on your choice of data signals. So, you're not estimating the actual channel, but a varyingly scaled channel.

For you here, it doesn't matter, because QPSK is all the same power, no matter which symbols are actually sent. It's still a bug. Normalizing on the receive side: don't do it.

yhat2 = conv(x_ifft1,channelTD.');

your conv does a linear convolution, but the convolution theorem for the DFT makes point-wise multiplication in the frequency domain equivalent to cyclic convolution in time.

That's why OFDM systems use cyclic prefix (or zero-filled guard intervals). Your system is lacking that, so you should be getting the boundary effects caused by this.

$\endgroup$
1
  • $\begingroup$ Hello Marcus, I appreciate your valuable feedback. I have made updates to my code based on your recommendations, as shown below. However, I am still encountering varying estimated channel results with each run. $\endgroup$
    – Zeynep
    Jun 6 at 11:09
0
$\begingroup$

The convoluted channel is in time domain.

The estimated channel is in freq domain.

Compare channel in the same domain. Then it would be similar.

Take ifft of estimated channel, the answer should be equal to convoluted channel.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.