Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8156913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:06:12+00:00 2026-06-06T17:06:12+00:00

I need star 16 QAM Modulator and demodulator design matlab code Please suggest me

  • 0

I need star 16 QAM Modulator and demodulator design matlab code

Please suggest me how to make the code. The sample constellation diagram given below.
I want to make the code for this constellation with different ring radius.

Sample Constellation Points enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:06:13+00:00Added an answer on June 6, 2026 at 5:06 pm

    Here‘s an example Matlab script that does Star-16-QAM mapping with Gray mapping, models an AWGN channel and does the decision and demapping. The bit error rate (BER) is also calculated. I’ll shortly explaing how it works.

    First, we create a random bit sequence with ‘0’ and ‘1’ occuring with equal probability. The radius of the inner and outer circle of the constellation diagram are also defined.

    % Random bit sequence
    numberOfBits = 1e5;
    x = rand(1, numberOfBits);
    x( x < 0.5 ) = 0;
    x( x >= 0.5 ) = 1;
    
    % Radius of inner and outer circle
    r1 = 1;
    r2 = 2;
    

    In the next step we define the mapping table that maps an integer index number to a complex symbol. This is done in such a way, that two neighbouring symbols only differ in one bit. This is called Gray mapping.

    % Define mapping table applying Gray mapping
    mappingTable(1) = r1 * exp(1i* 0);
    mappingTable(2) = r1 * exp(1i* pi/4);
    mappingTable(3) = r1 * exp(1i* 3*pi/4);
    mappingTable(4) = r1 * exp(1i* pi/2);
    mappingTable(5) = r1 * exp(1i* 7*pi/4);
    mappingTable(6) = r1 * exp(1i* 3*pi/2);
    mappingTable(7) = r1 * exp(1i* pi);
    mappingTable(8) = r1 * exp(1i* 5*pi/4);
    mappingTable(9:16) = mappingTable(1:8) ./ r1 .* r2;
    

    Now for each block of 4 bits we calculate the symbol index and look up the according complex symbol in our mapping table.

    if mod(numberOfBits, 4) ~= 0
        error('numberOfBits must be a multiple of 4.');
    end
    mappedSymbols = zeros(1, numberOfBits / 4);
    
    % Map bits to symbols
    for i = 1:4:length(x)
    
        symbolBits = x(i:i+3);
    
        symbolIndex = 2^3 * symbolBits(1) + 2^2 * symbolBits(2) + 2^1 * symbolBits(3) + 2^0 * symbolBits(4);
    
        % Mapping
        mappedSymbols((i - 1)/4 + 1) = mappingTable( symbolIndex + 1);
    end
    

    In a practical communication system the real and imaginary part of the complex symbols will now be converted to an analog signal (with an impulse shaper) and be modulated onto a radio frequency carrier. Here, we assume that D/A and A/D conversion as well as modulation and demodulation are ideal, so that we don’t need to model it. Furthermore, the channel is assumed to be ideal, i.e. flat in the frequency domain. However, we will consider noise by adding white Gaussian noise. Note that the noise power is equally distributed on the real and imaginary part of the signal.

    % Add white Gaussian noise
    snr = 20; % signal-to-noise ratio in dB
    meanSignalPower = (r1^2 + r2^2)/2;
    snr_lin = 10^(snr/10); % linear scale
    meanNoisePower = meanSignalPower ./ snr_lin;
    receivedSignal = mappedSymbols + randn(1, length(mappedSymbols)) * sqrt(meanNoisePower/2) +...
        1i * randn(1, length(mappedSymbols)) * sqrt(meanNoisePower/2);
    

    Finally, for each received symbol, we determine the constellation point with the minimum distance and convert the symbol index back to a sequence of bits.

    % Decision and demapping
    receivedBits = zeros(1, numberOfBits / 4);
    for i = 1:length(receivedSignal)
      [mindiff minIndex] = min(receivedSignal(i) - mappingTable);
      symbolIndex = minIndex - 1;
      bitString = dec2bin(symbolIndex, 4);
      receivedBits((i-1)*4 + 1) = str2double(bitString(1));
      receivedBits((i-1)*4 + 2) = str2double(bitString(2));
      receivedBits((i-1)*4 + 3) = str2double(bitString(3));
      receivedBits((i-1)*4 + 4) = str2double(bitString(4));
    end
    

    Of course, we’re interested in the number of bit errors:

    numberOfBitErrors = nnz( x - receivedBits );
    ber = numberOfBitErrors / numberOfBits; % bit error rate
    disp(['SNR: ' num2str(snr) ' dB']);
    disp(['Bit error rate (BER): ' num2str(ber)]);
    

    And plotting transmitted and received signal yields the typical constellation diagram:

    figure;
    plot( real(receivedSignal), imag(receivedSignal), '.'); hold on;
    absLim = max( max(real(receivedSignal)), max(imag(receivedSignal)));
    xyLimits = [-absLim*1.1 absLim*1.1];
    xlim( xyLimits );
    ylim( xyLimits );
    plot( real(mappedSymbols), imag(mappedSymbols), '.r'); hold off;
    xlim( xyLimits );
    ylim( xyLimits );
    xlabel('real part');
    ylabel('imaginary part');
    legend('received', 'transmitted');
    

    Consteallation diagram of Star-16-QAM after transmission over AWGN channel

    I uploaded the complete source code in a whole: http://pastebin.com/MDcVLZhh

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to make queries on fact table in star schema. I need
Need some regular expressions help. So far I have my code working to allow
I need to display a UI element (e.g. a star or checkmark) for employees
I am writing C# application that need to print data to POS STAR printer
I need to use, for example, the star-symbol(★) as the bullet for a list-item.
I have this star rating, I implemented from jQuery and I need to save
I'm using the following code for star rating. The code works fine in firefox
I need the ability to determine which Shape a given point falls within. There
I need to create about 10 radios for my star rating. At the end
I need a certain set of URLS to go to a Zend/MVC /races/super-star /races/race-57

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.