MATLAB: Result Convolution/ multiplication in freq domain not the same

convolutionfftfrequencyifft

Hi, I got a channel and I want to do a convolution with my Signal. I got a Test with multiplication in frequency domain – works fine. In time domain with convolution it doesn't work. My Signal is in real longer so i cant always use multiplication.
maybe you know the problem so I get the same signal with multiplication and convolution?
thank you!!
here i got my code:
I've seen that the fft result differs between row and column vector. Now I corrected to only row vectors, but no correct result… looks like impulse response wrong…
H_f = [0.0094 - 0.0373i, 0.0122 - 0.0326i, 0.0143 - 0.0279i, 0.0157 - 0.0247i];% channel spectrum
nSubcarriers = 4;
N = 64; % FFT



H_ifft = [0, H_f, zeros(1,N-2*length(H_f)-1), conj(H_f(end:-1:1))];
h_t = ifft(H_ifft, N); % impulse respone of channel
kk = 1e3;
data = (randn(1, 4*(kk+1)) >= 0);
iq_data_conv = [];
iq_data_freq = [];
for ii = 1:kk
Signal = 2*data(ii*4:(ii)*4+3) - 1;
TxSpectrum = [0, Signal, zeros(1,N-2*length(Signal)), conj(Signal(end:-1:1))];
ofdm_signal_t = ifft(TxSpectrum, N); % IFFT
%%%%%%%%%%%%%%%%%%%%%WITH CONVOLUTION
channel_signal_conv = conv(ofdm_signal_t, h_t);% CONV
channel_signal_conv = channel_signal_conv(1:length(ofdm_signal_t)); % cut
% ... noise ect

R_f = fft(channel_signal_conv, N); % FFT
s_rec = R_f(2:nSubcarriers+1);%Extracting the data carriers from the FFT output

iq_data_conv = [iq_data_conv s_rec];
%%%%%%%%%%%%%%%%%%%%%Multiplication in frequency domain
tmp = fft(ofdm_signal_t, N); % FFT
tmp = tmp(2:nSubcarriers+1);
tmpH = tmp.*H_f;
tmpC = [0, tmpH, 0, conj(tmpH(end:-1:1))];
channel_signal_freq = ifft(tmpC, N); % IFFT
% ... noise ect
R_f = fft(channel_signal_freq, N); % FFT
s_rec = R_f(2:nSubcarriers+1);%Extracting the data carriers from the FFT output
iq_data_freq = [iq_data_freq s_rec];
%%%%%%%%%%%%%%%%%%%%%
end
scatterplot(iq_data_conv);
scatterplot(iq_data_freq);

Best Answer

Hi I've got the problem. I forgot the cyclic prefix so i get ICI
best regards
Related Question