Вы находитесь на странице: 1из 6

Simulasi Modulasi Digital BPSK pada Kanal Ionosfer HF

%% Initialization of Simulation-Specific Parameters


% The simulation sampling rate is specified, and kept the same for the
% remainder of the demo. The input to the channel simulator is
oversampled
% by a factor of four.

M = 2; % DBPSK modulation order


hMod = comm.DBPSKModulator; % Create a DPSK modulator
hDemod = comm.DBPSKDemodulator; % Create a DPSK demodulator

Rsym = 1200; % Input symbol rate


Rbit = Rsym * log2(M); % Input bit rate
Nos = 4; % Oversampling factor
ts = (1/Rbit) / Nos; % Input sample period
fd = 1;

%% ITU-R F.1487 Low Latitudes, Moderate Conditions


hdchan = stdchan(ts, fd, 'iturHFLM')
% As before, we obtain the path gains by processing random data through
the
% channel. These path gains are stored in |y| for post-processing.

hdchan.StorePathGains = 1;
hdchan.ResetBeforeFiltering = 0;
hdchan.NormalizePathGains = 1;

% Generate data and apply fading channel.


tx = randi([0 M-1],100000,1); % Generate a random bit stream
dpskSig = step(hMod, tx); % DPSK modulate the signal
fadedSig = filter(hdchan,dpskSig); % Apply the channel effects

% Compute error rate for different values of SNR.


SNR = 0:2:20; % Range of SNR values, in dB.
numSNR = length(SNR);
berVec = zeros(3, numSNR);

% Create an AWGNChannel and ErrorRate calculator System object


hChan = comm.AWGNChannel('NoiseMethod', 'Signal to noise ratio (SNR)');

% Compute bit error rate, taking delay into account.


delay = hdchan.ChannelFilterDelay;
hErrorCalc = comm.ErrorRate('ReceiveDelay', delay);

for n = 1:numSNR
hChan.SNR = SNR(n);
rxSig = step(hChan,fadedSig); % Add Gaussian noise
rx = step(hDemod, rxSig); % Demodulate
reset(hErrorCalc)
% Compute error rate.
berVec(:,n) = step(hErrorCalc,tx,rx);
end
BER_LM = berVec(1,:);

%% ITU-R F.1487 High Latitudes, Disturbed Conditions


% As before, we obtain the path gains by processing random data through
the
% channel. These path gains are stored in |y| for post-processing.

hdchan = stdchan(ts, fd, 'iturHFHD')


hdchan.StorePathGains = 1;
hdchan.ResetBeforeFiltering = 0;
hdchan.NormalizePathGains = 1;

% Generate data and apply fading channel.


tx = randi([0 M-1],100000,1); % Generate a random bit stream
dpskSig = step(hMod, tx); % DPSK modulate the signal
fadedSig = filter(hdchan,dpskSig); % Apply the channel effects

% Compute error rate for different values of SNR.


SNR = 0:2:20; % Range of SNR values, in dB.
numSNR = length(SNR);
berVec = zeros(3, numSNR);

% Create an AWGNChannel and ErrorRate calculator System object


hChan = comm.AWGNChannel('NoiseMethod', 'Signal to noise ratio (SNR)');
%hErrorCalc = comm.ErrorRate;

% Compute bit error rate, taking delay into account.


delay = hdchan.ChannelFilterDelay;
hErrorCalc = comm.ErrorRate('ReceiveDelay', delay);

for n = 1:numSNR
hChan.SNR = SNR(n);
rxSig = step(hChan,fadedSig); % Add Gaussian noise
rx = step(hDemod, rxSig); % Demodulate
reset(hErrorCalc)
% Compute error rate.
berVec(:,n) = step(hErrorCalc,tx,rx);
end
BER_HD = berVec(1,:);

% Plot BER results.


semilogy(SNR,BER_LM,'b-*',SNR,BER_HD,'-r*');
legend('Low Latitudes, Moderate Conditions','High Latitudes, Disturbed
Conditions');
xlabel('SNR (dB)'); ylabel('BER');
title('Binary DPSK over HF Ionosphere Channel ITU-R F.1487 ');
grid on
Simulasi Modulasi Digital QPSK pada Kanal Ionosfer HF

%% Initialization of Simulation-Specific Parameters


% The simulation sampling rate is specified, and kept the same for the
% remainder of the demo. The input to the channel simulator is
oversampled
% by a factor of four.

M = 4; % DQPSK modulation order


hMod = comm.DQPSKModulator; % Create a DPSK modulator
hDemod = comm.DQPSKDemodulator; % Create a DPSK demodulator

Rsym = 1200; % Input symbol rate


Rbit = Rsym * log2(M); % Input bit rate
Nos = 4; % Oversampling factor
ts = (1/Rbit) / Nos; % Input sample period
fd = 1;

%% ITU-R F.1487 Low Latitudes, Moderate Conditions


hdchan = stdchan(ts, fd, 'iturHFLM')
% As before, we obtain the path gains by processing random data through
the
% channel. These path gains are stored in |y| for post-processing.

hdchan.StorePathGains = 1;
hdchan.ResetBeforeFiltering = 0;
hdchan.NormalizePathGains = 1;

% Generate data and apply fading channel.


tx = randi([0 M-1],100000,1); % Generate a random bit stream
dpskSig = step(hMod, tx); % DPSK modulate the signal
fadedSig = filter(hdchan,dpskSig); % Apply the channel effects

% Compute error rate for different values of SNR.


SNR = 0:2:20; % Range of SNR values, in dB.
numSNR = length(SNR);
berVec = zeros(3, numSNR);

% Create an AWGNChannel and ErrorRate calculator System object


hChan = comm.AWGNChannel('NoiseMethod', 'Signal to noise ratio (SNR)');

% Compute bit error rate, taking delay into account.


delay = hdchan.ChannelFilterDelay;
hErrorCalc = comm.ErrorRate('ReceiveDelay', delay);

for n = 1:numSNR
hChan.SNR = SNR(n);
rxSig = step(hChan,fadedSig); % Add Gaussian noise
rx = step(hDemod, rxSig); % Demodulate
reset(hErrorCalc)
% Compute error rate.
berVec(:,n) = step(hErrorCalc,tx,rx);
end
BER_LM = berVec(1,:);

%% ITU-R F.1487 High Latitudes, Disturbed Conditions

% As before, we obtain the path gains by processing random data through


the
% channel. These path gains are stored in |y| for post-processing.

hdchan = stdchan(ts, fd, 'iturHFHD')


hdchan.StorePathGains = 1;
hdchan.ResetBeforeFiltering = 0;
hdchan.NormalizePathGains = 1;

% Generate data and apply fading channel.


tx = randi([0 M-1],100000,1); % Generate a random bit stream
dpskSig = step(hMod, tx); % DPSK modulate the signal
fadedSig = filter(hdchan,dpskSig); % Apply the channel effects

% Compute error rate for different values of SNR.


SNR = 0:2:20; % Range of SNR values, in dB.
numSNR = length(SNR);
berVec = zeros(3, numSNR);

% Create an AWGNChannel and ErrorRate calculator System object


hChan = comm.AWGNChannel('NoiseMethod', 'Signal to noise ratio (SNR)');
%hErrorCalc = comm.ErrorRate;

% Compute bit error rate, taking delay into account.


delay = hdchan.ChannelFilterDelay;
hErrorCalc = comm.ErrorRate('ReceiveDelay', delay);

for n = 1:numSNR
hChan.SNR = SNR(n);
rxSig = step(hChan,fadedSig); % Add Gaussian noise
rx = step(hDemod, rxSig); % Demodulate
reset(hErrorCalc)
% Compute error rate.
berVec(:,n) = step(hErrorCalc,tx,rx);
end
BER_HD = berVec(1,:);

% Plot BER results.


semilogy(SNR,BER_LM,'b-*',SNR,BER_HD,'-r*');
legend('Low Latitudes, Moderate Conditions','High Latitudes, Disturbed
Conditions');
xlabel('SNR (dB)'); ylabel('BER');
title('Quartenary DPSK over HF Ionosphere Channel ITU-R F.1487 ');
grid on

Вам также может понравиться