Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/How to modify modem.qammod for the latest MATLAB version?

How to modify modem.qammod for the latest MATLAB version?

PuTI / 2025-01-23
How to modify modem.qammod for the latest MATLAB version?
Matlab News

clc ;
clear all ;
close all ;
m =512; % Total number of OFDM symbols
N =1024; % Length of each OFDM symbol
M =4; % Size of the Constellation ( M can be 4 , 8 , 16 ,32 , 64 , 128 , 256)

pilotFrequency =8 ; % Pilot Symbol insertion frequency
E =2; % Energy of each Pilot Symbol
Ncp =256 ; % Length of the Cyclic Prefix
Tx = modem.qammod (‘M’,M ) ; % Choosing the modulation format as M – ary Quadrature Amplitude Modulation (M- QAM )
Rx = modem.qamdemod (‘M’,M) ; % Fixing up the demodulation format at the receiving end as M – ary QAM

% ACO – OFDM Transmitter
Data = randi ([0 M-1] ,m , N ); % Generation of Random bits Matrix of size m by N
for k1 =1: m
for m1 =1: N
if mod ( m1 ,2) ==0 % Performing Modulo operation to extract the even subcarriers
Data ( k1 , m1 ) =0; % Setting the Even Subcarriers to Zero
end
end
end

DataMod = modulate ( Tx , Data ) ; % Performing Data Modulation
DataMod_serialtoparallel = DataMod .’; % Performing Serial to Parallel Conversion
PLoc = 1: pilotFrequency :N ; % Fixing the location of Pilot carrires
DLoc = setxor (1: N , PLoc ) ; % Fixing the location of Data subcarriers
DataMod_serialtoparallel ( PLoc ,:) = E*DataMod_serialtoparallel ( PLoc ,:) ; % Inserting Pilot carriers

datamat = DataMod_serialtoparallel ; % Assigning the total data including the pilots to a variable called datamat
% Computation of Hermitian Symmetry Criteria
datamat (1 ,:) =0; % Assigning the First subcarrier to Zero
datamat (513 ,:) =0; % Assigning the Middle Subcarrier to Zero
datamat (514:1024 ,:) = flipud ( conj ( datamat (2:512 ,:) )) ; % Illustrating that only half of the subcarriers are exploited for data transmission as the remaining half are flipped complex conjugate versions of the previous ones .

d_ifft = ifft (( datamat ) ) ; % Computation of IFFT operation

% Ensuring that only the positive portion of the signal is transmitted
for k2 =1: N
for m2 =1: m
if( d_ifft ( k2 , m2 ) <0)
d_ifft ( k2 , m2 ) =0;
end
end
end

d_ifft_paralleltoserial = d_ifft .’; % Parallel to Serial Conversion
CP_part = d_ifft_paralleltoserial (: ,end – Ncp +1: end) ; %Addition of Cyclic Prefix
ACOOFDM_CP =[ CP_part d_ifft_paralleltoserial ]; %Transmissin of ACO – OFDM signal

% VLC Channel Modeling
theta = 70; %LED semi – angle
ml = – log10 (2) / log10 ( cos ( theta ) ) ; % Computation of Lambertian Mode Number
APD =0.01; % Area of the photodiode
lx =5; ly =5; lz =3; % Size of the Dimensions of the Indoor Room Environment
h =2.15;
[ XT , YT ]= meshgrid ([ – lx /4 lx /4] ,[ – ly /4 ly /4]) ;
Nx = lx *5; Ny = ly *5;
x = linspace ( – lx /2 , lx /2 , Nx );
y = linspace ( – ly /2 , ly /2 , Ny );
[ XR , YR ]= meshgrid (x , y );

D1 = sqrt (( XR – XT (1 ,1) ) .^2+( YR – YT (1 ,1) ) .^2+ h ^2) ;
D2 = sqrt (( XR – XT (2 ,2) ) .^2+( YR – YT (2 ,2) ) .^2+ h ^2) ;
cosphi_A1 = h ./ D1 ;
receiver_angle = acosd ( cosphi_A1 ) ;

H_A1 =3600*(( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .* D1.^2) +( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .^2* D1.^2* D2 .^2) ) ; % Computation of VLC channel Impulse Response taking into consideration Non Line of Sight ( NLOS ) Environment
H_A2 = H_A1 ./ norm ( H_A1 );

d_channell = filter ( H_A2 (1 ,1:2) ,1 , ACOOFDM_CP .’) .’; %Illustration of channel effect on the transmitted ACO – OFDM signal

count =0;
snr_vector =0:1:30; % size of signal to noise ratio (SNR ) vector

for snr = snr_vector
SNR = snr + 10* log10 ( log2 (M ) ) ;
count = count +1 ;
ACOOFDM_with_chann = awgn(d_channell , SNR ,’measured’) ; % Addition of AWGN
% Receiver of ACO – OFDM
ACOOFDM_removal_CP = ACOOFDM_with_chann (: , Ncp+1: N + Ncp );
% Removal of Cyclic Prefix
ACOOFDM_serialtoparallel = ACOOFDM_removal_CP .’; %Serial to Parallel Conversion
ACOOFDM_parallel_fft = fft ( ACOOFDM_serialtoparallel) ;
% Computation of FFT operation
% Channel Estimation
TransmittedPilots = DataMod_serialtoparallel ( PLoc,:) ; % Extracting the transmitted pilots
ReceivedPilots = ACOOFDM_parallel_fft ( PLoc ,:) ;
%Extracting the received pilot tones effected by channel
for r =1:m
H_MMSE(: , r ) = MMSE(ReceivedPilots(: , r ) ,TransmittedPilots(: , r ), N, pilotFrequency, H_A2(1 ,1:2), SNR);% Minimum Mean SquareError ( MMSE ) Channel Estimation
end

HData_MMSE_parallel1 = H_MMSE.’;
ACOOFDM_SERIAL_MMSE = demodulate(Rx ,(ACOOFDM_parallel_fft.’)./( HData_MMSE_parallel1) ) ;

% Recovery of Pilots from the Original Transmitted signal and Received Signal
Data_no_pilots = Data (: , DLoc ) ;
Recovered_Pilot_MMSE = ACOOFDM_SERIAL_MMSE (: , DLoc ) ;
% Computation of Bit Error Rate
[~ , recoveredMMSE( count ) ]= biterr ( Data_no_pilots (: ,2:255) , Recovered_Pilot_MMSE (: ,2:255) ) ;
end
% Plotting the BER curves
semilogy ( snr_vector , recoveredMMSE ,’gs -‘,’LineWidth’,2) ;
axis ([0 30 10^ -4 1]) ;
grid on ;

function H_MMSE = MMSE(RxP,TxP,N,pilotFrequency,h_CIR,SNR)
% I modified the MMSE_CE function provided in :MIMO-OFDM Wireless
% Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim,
% Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd
% The modification made the function more suitable with my OFDM Matlab code
noiseVar = 10^(SNR*0.1);
Np=N/pilotFrequency; % Number of Pilots
H_LS = RxP./TxP; % LS estimate
k=0:length(h_CIR)-1;
hh = h_CIR*h_CIR’;
% tmp = h_CIR.*conj(h_CIR).*k;
r = sum(h_CIR.*conj(h_CIR).*k)/hh;
r2 = (h_CIR.*conj(h_CIR).*k)*k.’/hh;
t_rms = sqrt(r2-r^2); % rms delay
D = 1j*2*pi*t_rms/N; % Denomerator of Eq. (6.16) page 192
K1 = repmat([0:N-1].’,1,Np);
K2 = repmat([0:Np-1],N,1);
rf = 1./(1+D*(K1-K2*pilotFrequency));
K3 = repmat([0:Np-1].’,1,Np);
K4 = repmat([0:Np-1],Np,1);
rf2 = 1./(1+D*pilotFrequency*(K3-K4));
Rhp = rf;
Rpp = rf2 + eye(length(H_LS),length(H_LS))/noiseVar;
H_MMSE = transpose(Rhp*inv(Rpp)*H_LS); % MMSE channel estimate

endclc ;
clear all ;
close all ;
m =512; % Total number of OFDM symbols
N =1024; % Length of each OFDM symbol
M =4; % Size of the Constellation ( M can be 4 , 8 , 16 ,32 , 64 , 128 , 256)

pilotFrequency =8 ; % Pilot Symbol insertion frequency
E =2; % Energy of each Pilot Symbol
Ncp =256 ; % Length of the Cyclic Prefix
Tx = modem.qammod (‘M’,M ) ; % Choosing the modulation format as M – ary Quadrature Amplitude Modulation (M- QAM )
Rx = modem.qamdemod (‘M’,M) ; % Fixing up the demodulation format at the receiving end as M – ary QAM

% ACO – OFDM Transmitter
Data = randi ([0 M-1] ,m , N ); % Generation of Random bits Matrix of size m by N
for k1 =1: m
for m1 =1: N
if mod ( m1 ,2) ==0 % Performing Modulo operation to extract the even subcarriers
Data ( k1 , m1 ) =0; % Setting the Even Subcarriers to Zero
end
end
end

DataMod = modulate ( Tx , Data ) ; % Performing Data Modulation
DataMod_serialtoparallel = DataMod .’; % Performing Serial to Parallel Conversion
PLoc = 1: pilotFrequency :N ; % Fixing the location of Pilot carrires
DLoc = setxor (1: N , PLoc ) ; % Fixing the location of Data subcarriers
DataMod_serialtoparallel ( PLoc ,:) = E*DataMod_serialtoparallel ( PLoc ,:) ; % Inserting Pilot carriers

datamat = DataMod_serialtoparallel ; % Assigning the total data including the pilots to a variable called datamat
% Computation of Hermitian Symmetry Criteria
datamat (1 ,:) =0; % Assigning the First subcarrier to Zero
datamat (513 ,:) =0; % Assigning the Middle Subcarrier to Zero
datamat (514:1024 ,:) = flipud ( conj ( datamat (2:512 ,:) )) ; % Illustrating that only half of the subcarriers are exploited for data transmission as the remaining half are flipped complex conjugate versions of the previous ones .

d_ifft = ifft (( datamat ) ) ; % Computation of IFFT operation

% Ensuring that only the positive portion of the signal is transmitted
for k2 =1: N
for m2 =1: m
if( d_ifft ( k2 , m2 ) <0)
d_ifft ( k2 , m2 ) =0;
end
end
end

d_ifft_paralleltoserial = d_ifft .’; % Parallel to Serial Conversion
CP_part = d_ifft_paralleltoserial (: ,end – Ncp +1: end) ; %Addition of Cyclic Prefix
ACOOFDM_CP =[ CP_part d_ifft_paralleltoserial ]; %Transmissin of ACO – OFDM signal

% VLC Channel Modeling
theta = 70; %LED semi – angle
ml = – log10 (2) / log10 ( cos ( theta ) ) ; % Computation of Lambertian Mode Number
APD =0.01; % Area of the photodiode
lx =5; ly =5; lz =3; % Size of the Dimensions of the Indoor Room Environment
h =2.15;
[ XT , YT ]= meshgrid ([ – lx /4 lx /4] ,[ – ly /4 ly /4]) ;
Nx = lx *5; Ny = ly *5;
x = linspace ( – lx /2 , lx /2 , Nx );
y = linspace ( – ly /2 , ly /2 , Ny );
[ XR , YR ]= meshgrid (x , y );

D1 = sqrt (( XR – XT (1 ,1) ) .^2+( YR – YT (1 ,1) ) .^2+ h ^2) ;
D2 = sqrt (( XR – XT (2 ,2) ) .^2+( YR – YT (2 ,2) ) .^2+ h ^2) ;
cosphi_A1 = h ./ D1 ;
receiver_angle = acosd ( cosphi_A1 ) ;

H_A1 =3600*(( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .* D1.^2) +( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .^2* D1.^2* D2 .^2) ) ; % Computation of VLC channel Impulse Response taking into consideration Non Line of Sight ( NLOS ) Environment
H_A2 = H_A1 ./ norm ( H_A1 );

d_channell = filter ( H_A2 (1 ,1:2) ,1 , ACOOFDM_CP .’) .’; %Illustration of channel effect on the transmitted ACO – OFDM signal

count =0;
snr_vector =0:1:30; % size of signal to noise ratio (SNR ) vector

for snr = snr_vector
SNR = snr + 10* log10 ( log2 (M ) ) ;
count = count +1 ;
ACOOFDM_with_chann = awgn(d_channell , SNR ,’measured’) ; % Addition of AWGN
% Receiver of ACO – OFDM
ACOOFDM_removal_CP = ACOOFDM_with_chann (: , Ncp+1: N + Ncp );
% Removal of Cyclic Prefix
ACOOFDM_serialtoparallel = ACOOFDM_removal_CP .’; %Serial to Parallel Conversion
ACOOFDM_parallel_fft = fft ( ACOOFDM_serialtoparallel) ;
% Computation of FFT operation
% Channel Estimation
TransmittedPilots = DataMod_serialtoparallel ( PLoc,:) ; % Extracting the transmitted pilots
ReceivedPilots = ACOOFDM_parallel_fft ( PLoc ,:) ;
%Extracting the received pilot tones effected by channel
for r =1:m
H_MMSE(: , r ) = MMSE(ReceivedPilots(: , r ) ,TransmittedPilots(: , r ), N, pilotFrequency, H_A2(1 ,1:2), SNR);% Minimum Mean SquareError ( MMSE ) Channel Estimation
end

HData_MMSE_parallel1 = H_MMSE.’;
ACOOFDM_SERIAL_MMSE = demodulate(Rx ,(ACOOFDM_parallel_fft.’)./( HData_MMSE_parallel1) ) ;

% Recovery of Pilots from the Original Transmitted signal and Received Signal
Data_no_pilots = Data (: , DLoc ) ;
Recovered_Pilot_MMSE = ACOOFDM_SERIAL_MMSE (: , DLoc ) ;
% Computation of Bit Error Rate
[~ , recoveredMMSE( count ) ]= biterr ( Data_no_pilots (: ,2:255) , Recovered_Pilot_MMSE (: ,2:255) ) ;
end
% Plotting the BER curves
semilogy ( snr_vector , recoveredMMSE ,’gs -‘,’LineWidth’,2) ;
axis ([0 30 10^ -4 1]) ;
grid on ;

function H_MMSE = MMSE(RxP,TxP,N,pilotFrequency,h_CIR,SNR)
% I modified the MMSE_CE function provided in :MIMO-OFDM Wireless
% Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim,
% Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd
% The modification made the function more suitable with my OFDM Matlab code
noiseVar = 10^(SNR*0.1);
Np=N/pilotFrequency; % Number of Pilots
H_LS = RxP./TxP; % LS estimate
k=0:length(h_CIR)-1;
hh = h_CIR*h_CIR’;
% tmp = h_CIR.*conj(h_CIR).*k;
r = sum(h_CIR.*conj(h_CIR).*k)/hh;
r2 = (h_CIR.*conj(h_CIR).*k)*k.’/hh;
t_rms = sqrt(r2-r^2); % rms delay
D = 1j*2*pi*t_rms/N; % Denomerator of Eq. (6.16) page 192
K1 = repmat([0:N-1].’,1,Np);
K2 = repmat([0:Np-1],N,1);
rf = 1./(1+D*(K1-K2*pilotFrequency));
K3 = repmat([0:Np-1].’,1,Np);
K4 = repmat([0:Np-1],Np,1);
rf2 = 1./(1+D*pilotFrequency*(K3-K4));
Rhp = rf;
Rpp = rf2 + eye(length(H_LS),length(H_LS))/noiseVar;
H_MMSE = transpose(Rhp*inv(Rpp)*H_LS); % MMSE channel estimate

end clc ;
clear all ;
close all ;
m =512; % Total number of OFDM symbols
N =1024; % Length of each OFDM symbol
M =4; % Size of the Constellation ( M can be 4 , 8 , 16 ,32 , 64 , 128 , 256)

pilotFrequency =8 ; % Pilot Symbol insertion frequency
E =2; % Energy of each Pilot Symbol
Ncp =256 ; % Length of the Cyclic Prefix
Tx = modem.qammod (‘M’,M ) ; % Choosing the modulation format as M – ary Quadrature Amplitude Modulation (M- QAM )
Rx = modem.qamdemod (‘M’,M) ; % Fixing up the demodulation format at the receiving end as M – ary QAM

% ACO – OFDM Transmitter
Data = randi ([0 M-1] ,m , N ); % Generation of Random bits Matrix of size m by N
for k1 =1: m
for m1 =1: N
if mod ( m1 ,2) ==0 % Performing Modulo operation to extract the even subcarriers
Data ( k1 , m1 ) =0; % Setting the Even Subcarriers to Zero
end
end
end

DataMod = modulate ( Tx , Data ) ; % Performing Data Modulation
DataMod_serialtoparallel = DataMod .’; % Performing Serial to Parallel Conversion
PLoc = 1: pilotFrequency :N ; % Fixing the location of Pilot carrires
DLoc = setxor (1: N , PLoc ) ; % Fixing the location of Data subcarriers
DataMod_serialtoparallel ( PLoc ,:) = E*DataMod_serialtoparallel ( PLoc ,:) ; % Inserting Pilot carriers

datamat = DataMod_serialtoparallel ; % Assigning the total data including the pilots to a variable called datamat
% Computation of Hermitian Symmetry Criteria
datamat (1 ,:) =0; % Assigning the First subcarrier to Zero
datamat (513 ,:) =0; % Assigning the Middle Subcarrier to Zero
datamat (514:1024 ,:) = flipud ( conj ( datamat (2:512 ,:) )) ; % Illustrating that only half of the subcarriers are exploited for data transmission as the remaining half are flipped complex conjugate versions of the previous ones .

d_ifft = ifft (( datamat ) ) ; % Computation of IFFT operation

% Ensuring that only the positive portion of the signal is transmitted
for k2 =1: N
for m2 =1: m
if( d_ifft ( k2 , m2 ) <0)
d_ifft ( k2 , m2 ) =0;
end
end
end

d_ifft_paralleltoserial = d_ifft .’; % Parallel to Serial Conversion
CP_part = d_ifft_paralleltoserial (: ,end – Ncp +1: end) ; %Addition of Cyclic Prefix
ACOOFDM_CP =[ CP_part d_ifft_paralleltoserial ]; %Transmissin of ACO – OFDM signal

% VLC Channel Modeling
theta = 70; %LED semi – angle
ml = – log10 (2) / log10 ( cos ( theta ) ) ; % Computation of Lambertian Mode Number
APD =0.01; % Area of the photodiode
lx =5; ly =5; lz =3; % Size of the Dimensions of the Indoor Room Environment
h =2.15;
[ XT , YT ]= meshgrid ([ – lx /4 lx /4] ,[ – ly /4 ly /4]) ;
Nx = lx *5; Ny = ly *5;
x = linspace ( – lx /2 , lx /2 , Nx );
y = linspace ( – ly /2 , ly /2 , Ny );
[ XR , YR ]= meshgrid (x , y );

D1 = sqrt (( XR – XT (1 ,1) ) .^2+( YR – YT (1 ,1) ) .^2+ h ^2) ;
D2 = sqrt (( XR – XT (2 ,2) ) .^2+( YR – YT (2 ,2) ) .^2+ h ^2) ;
cosphi_A1 = h ./ D1 ;
receiver_angle = acosd ( cosphi_A1 ) ;

H_A1 =3600*(( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .* D1.^2) +( ml +1) * APD .* cosphi_A1 .^( ml +1) ./(2* pi .^2* D1.^2* D2 .^2) ) ; % Computation of VLC channel Impulse Response taking into consideration Non Line of Sight ( NLOS ) Environment
H_A2 = H_A1 ./ norm ( H_A1 );

d_channell = filter ( H_A2 (1 ,1:2) ,1 , ACOOFDM_CP .’) .’; %Illustration of channel effect on the transmitted ACO – OFDM signal

count =0;
snr_vector =0:1:30; % size of signal to noise ratio (SNR ) vector

for snr = snr_vector
SNR = snr + 10* log10 ( log2 (M ) ) ;
count = count +1 ;
ACOOFDM_with_chann = awgn(d_channell , SNR ,’measured’) ; % Addition of AWGN
% Receiver of ACO – OFDM
ACOOFDM_removal_CP = ACOOFDM_with_chann (: , Ncp+1: N + Ncp );
% Removal of Cyclic Prefix
ACOOFDM_serialtoparallel = ACOOFDM_removal_CP .’; %Serial to Parallel Conversion
ACOOFDM_parallel_fft = fft ( ACOOFDM_serialtoparallel) ;
% Computation of FFT operation
% Channel Estimation
TransmittedPilots = DataMod_serialtoparallel ( PLoc,:) ; % Extracting the transmitted pilots
ReceivedPilots = ACOOFDM_parallel_fft ( PLoc ,:) ;
%Extracting the received pilot tones effected by channel
for r =1:m
H_MMSE(: , r ) = MMSE(ReceivedPilots(: , r ) ,TransmittedPilots(: , r ), N, pilotFrequency, H_A2(1 ,1:2), SNR);% Minimum Mean SquareError ( MMSE ) Channel Estimation
end

HData_MMSE_parallel1 = H_MMSE.’;
ACOOFDM_SERIAL_MMSE = demodulate(Rx ,(ACOOFDM_parallel_fft.’)./( HData_MMSE_parallel1) ) ;

% Recovery of Pilots from the Original Transmitted signal and Received Signal
Data_no_pilots = Data (: , DLoc ) ;
Recovered_Pilot_MMSE = ACOOFDM_SERIAL_MMSE (: , DLoc ) ;
% Computation of Bit Error Rate
[~ , recoveredMMSE( count ) ]= biterr ( Data_no_pilots (: ,2:255) , Recovered_Pilot_MMSE (: ,2:255) ) ;
end
% Plotting the BER curves
semilogy ( snr_vector , recoveredMMSE ,’gs -‘,’LineWidth’,2) ;
axis ([0 30 10^ -4 1]) ;
grid on ;

function H_MMSE = MMSE(RxP,TxP,N,pilotFrequency,h_CIR,SNR)
% I modified the MMSE_CE function provided in :MIMO-OFDM Wireless
% Communications with MATLAB¢ç Yong Soo Cho, Jaekwon Kim,
% Won Young Yang and Chung G. Kang
%2010 John Wiley & Sons (Asia) Pte Ltd
% The modification made the function more suitable with my OFDM Matlab code
noiseVar = 10^(SNR*0.1);
Np=N/pilotFrequency; % Number of Pilots
H_LS = RxP./TxP; % LS estimate
k=0:length(h_CIR)-1;
hh = h_CIR*h_CIR’;
% tmp = h_CIR.*conj(h_CIR).*k;
r = sum(h_CIR.*conj(h_CIR).*k)/hh;
r2 = (h_CIR.*conj(h_CIR).*k)*k.’/hh;
t_rms = sqrt(r2-r^2); % rms delay
D = 1j*2*pi*t_rms/N; % Denomerator of Eq. (6.16) page 192
K1 = repmat([0:N-1].’,1,Np);
K2 = repmat([0:Np-1],N,1);
rf = 1./(1+D*(K1-K2*pilotFrequency));
K3 = repmat([0:Np-1].’,1,Np);
K4 = repmat([0:Np-1],Np,1);
rf2 = 1./(1+D*pilotFrequency*(K3-K4));
Rhp = rf;
Rpp = rf2 + eye(length(H_LS),length(H_LS))/noiseVar;
H_MMSE = transpose(Rhp*inv(Rpp)*H_LS); % MMSE channel estimate

end matlab, ofdm, channel estimation, visible light communication, ber, snr, modem.qammod, qammod MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

Optimal decimation to Log Simulation Data
2025-05-18

Optimal decimation to Log Simulation Data

I need to use a scope to display the current i and the power P as functions of the voltage V, with the curves obtained for various irradiance levels and temperatures
2025-05-18

I need to use a scope to display the current i and the power P as functions of the voltage V, with the curves obtained for various irradiance levels and temperatures

Break in and break away points on Root Locus
2025-05-18

Break in and break away points on Root Locus

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss