File:Soft34.png
Page contents not supported in other languages.
Tools
Actions
General
In other projects
Appearance
Soft34.png (577 × 433 pixels, file size: 19 KB, MIME type: image/png)
This is a file from the Wikimedia Commons. Information from its description page there is shown below. Commons is a freely licensed media file repository. You can help. |
Summary
DescriptionSoft34.png |
English: Created with help to MatLab 2014a.
The main structural blocks for the simulation: 1) Message source; 2) M-QAM modulator (M is adjustable); 3) Convolutional encoder; 4) AWGN channel; 5) M-QAM demodulator with Approximate LLR (or Exact LLR) outputs; 6) Soft decision Viterbi decoder; 7) BER calculation. |
||
Date | |||
Source | Own work | ||
Author | Kirlf | ||
Other versions |
|
||
PNG development InfoField | This diagram was created with MATLAB. | ||
Source code InfoField | MATLAB codeclear; close all; clc
rng default
M = 4; % Modulation order
k = log2(M); % Bits per symbol
EbNoVec = (0:6)'; % Eb/No values (dB)
numSymPerFrame = 300000; % Number of QAM symbols per frame
modul = comm.PSKModulator(M, 'BitInput', true);
berEstSoft = zeros(size(EbNoVec));
trellis = poly2trellis(7,[171 133]);
tbl = 96;
rate = 3/4;
spect = distspec(trellis);
encoders = comm.ConvolutionalEncoder(trellis,...
'PuncturePatternSource', 'Property', 'PuncturePattern', [1; 1; 0; 1; 0; 1]);
decoders = comm.ViterbiDecoder(trellis,'TracebackDepth',tbl,...
'TerminationMethod','Continuous','InputFormat','Unquantized',...
'PuncturePatternSource', 'Property', 'PuncturePattern', [1; 1; 0; 1; 0; 1]);
for n = 1:length(EbNoVec)
% Convert Eb/No to SNR
snrdB = EbNoVec(n) + 10*log10(k*rate);
% Noise variance calculation for unity average signal power.
noiseVar = 10.^(-snrdB/10);
% Reset the error and bit counters
[numErrsSoft, numErrsHard, numBits] = deal(0);
while numErrsSoft < 100 && numBits < 1e7
% Generate binary data and convert to symbols
dataIn = randi([0 1], numSymPerFrame*k, 1);
% Convolutionally encode the data
dataEnc = step(encoders, dataIn);
% QAM modulate
txSig = step(modul, dataEnc);
% Pass through AWGN channel
rxSig = awgn(txSig, snrdB, 'measured');
% Demodulate the noisy signal using hard decision (bit) and
% soft decision (approximate LLR) approaches.
demods = comm.PSKDemodulator(M, 'BitOutput', true, ...
'DecisionMethod', 'Approximate log-likelihood ratio', 'VarianceSource', 'Property', 'Variance', noiseVar);
rxDataSoft = step(demods, rxSig);
% Viterbi decode the demodulated data
dataSoft = step(decoders, rxDataSoft);
% Calculate the number of bit errors in the frame. Adjust for the
% decoding delay, which is equal to the traceback depth.
numErrsInFrameSoft = biterr(dataIn(1:end-tbl), dataSoft(tbl+1:end));
% Increment the error and bit counters
numErrsSoft = numErrsSoft + numErrsInFrameSoft;
numBits = numBits + numSymPerFrame*k;
end
% Estimate the BER for both methods
berEstSoft(n) = numErrsSoft/numBits;
end
%% Theoretical curves
spect = distspec(trellis, 7);
soft_bertool = bercoding(EbNoVec,'conv','soft',1/2,spect); % BER bound
figure(1)
semilogy(EbNoVec, soft_bertool.','-o',EbNoVec,berEstSoft.','-o', 'LineWidth', 1.5)
grid on
hold on
legend('1/2 (theory)','3/4 (simulation)','location','best')
grid on
xlabel('Eb/No (dB)')
ylabel('Bit Error Rate')
|
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Items portrayed in this file
depicts
some value
17 January 2019
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 20:58, 30 December 2020 | 577 × 433 (19 KB) | Kirlf | looks better | |
06:59, 6 February 2019 | 561 × 420 (8 KB) | Kirlf | User created page with UploadWizard |
File usage
The following page uses this file:
Metadata
This file contains additional information, probably added from the digital camera or scanner used to create or digitize it.
If the file has been modified from its original state, some details may not fully reflect the modified file.
Horizontal resolution | 38.98 dpc |
---|---|
Vertical resolution | 38.98 dpc |
File change date and time | 20:57, 30 December 2020 |
Software used | |
Date and time of digitizing |
|
Retrieved from "https://en.wikipedia.org/wiki/File:Soft34.png"