thavamaran
Member level 4
Hi guys, Im having problem with on analyzing the time of the symbols or bandwidth of the discrete signals after IFFT in OFDM. Below are my codes that I used.
The problem is, I want to fix a low pass filter after y_samp to remove all the harmonics, the spectrum looks fine with signal centered at 20 MHz, but after filtering at the first crossing at 40 MHz, my received signal looks crazy, but without filtering, I could retrieve my signal at the receiver in perfect condition! , but I want to filter it for other purposes, I also compensated the delay that occurred cause of the filter.
So I thought may be I could look at the time or bandwidth after IFFT (IFFT_data in the code) before upsampling it to 20 MHz bandwidth, but the problem is I dont have a sampling frequency that is defined cause IFFT is a default function of matlab.
Can anyone suggest me a way or option to look at the bandwidth.
Code:
nchannel1=128; %Total number of carriers
nchannel =76; %Occupied carriers with OFDM symbols
padding=nchannel1-nchannel; %zero padding
nsym =4; % number of symbols
pilotsym =2; %pilot symbols
t_data=randint(nchannel*nsym*m,1,2); %raw bits
res=reshape(t_data,m,nchannel*nsym); %reshape into
equivalent
subcarries
qamdata=bi2de(res.','left-msb'); %symbol levels
maping = bin2gray(qamdata,'qam',m^2); %Gray coding
mod_data =modulate(M,maping); %mapping
par_data = reshape(mod_data,nchannel,nsym).'; %S/P
zero_pad=[zeros(nsym,(padding-2)/2) par_data(:,[1:nchannel/2]) zeros(nsym,2) par_data(:,[nchannel/2+1:nchannel]) zeros(nsym,(padding-2)/2)]; %zero padding, making it 128 subcarriers
pilot_ins_trial=[pilot zero_pad pilot]; %inserting pilot
IFFT_data =ifft(fftshift( pilot_ins_trial.')).'; performing IFFT
cylic_add_data = [IFFT_data(:,[nchannel1-gilen+1:nchannel1]) IFFT_data]; %adding CP
y_samp=[];
t=1/Ufs:1/Ufs:Tc; %Ufs=samping frequency
%Tc=1/fc=20 MHz
nsamp=length(t);
for iii=1:length(cyclic_add_data1)
y_samp=[y_samp cyclic_add_data1(iii).*square(2*pi*fc*t)]; %upsampling with
%rectagular shape
%filter
end
The problem is, I want to fix a low pass filter after y_samp to remove all the harmonics, the spectrum looks fine with signal centered at 20 MHz, but after filtering at the first crossing at 40 MHz, my received signal looks crazy, but without filtering, I could retrieve my signal at the receiver in perfect condition! , but I want to filter it for other purposes, I also compensated the delay that occurred cause of the filter.
So I thought may be I could look at the time or bandwidth after IFFT (IFFT_data in the code) before upsampling it to 20 MHz bandwidth, but the problem is I dont have a sampling frequency that is defined cause IFFT is a default function of matlab.
Can anyone suggest me a way or option to look at the bandwidth.