Skip to main content
Home Wireless Communication Modulation MATLAB Beamforming Project Ideas MIMO Computer Networks Lab 🚀

How to use MATLAB Simulink

 

MATLAB Simulink is a popular add-on of MATLAB. Here, you can use different blocks like modulator, demodulator, AWGN channel, etc. And you can do experiments on your own.

 


 

 

Steps

  1. Go to the 'Simulink' tab at the top navbar of MATLAB. If not found, click on the add-on tab, search 'Simulink,' and then click on it to add.
  2. Once you installed the simulation, click the 'new' tap at the top left corner.
  3. Then, search the required blocks in the 'Simulink library.' Then, drag it to the editor space.
  4. You can double-click on the blocks to see the input parameters
  5. Then, connect the blocks by dragging a line from one block's output terminal to another block's input.
  6. If the connection is complete, click the 'run' tab in the middle of the top navbar.  
  7. After clicking on the run button, your Simulink is ready. Then double-click on any block to see the output
  8.  
  9. The following block diagram is an example of the MATLAB simulation of 'QPSK' or quadrature phase shift keying.
  1.  
    Fig: QPSK Modulation and Demodulation
     
     
     

    In the above figure, for QPSK modulation and demodulation, we've used blocks like Random Integer Generator to generate the random integers 0, 1, 2, and 3, which are the inputs of the QPSK modulators. Then, the signal passes thru the AWGN channel. At the receiver side, we demodulate the signal using a QPSK demodulator. A scope is connected to the output terminal of the demodulator. Scopes are used to visualize the output signal.


People are good at skipping over material they already know!

View Related Topics to







Admin & Author: Salim

profile

  Website: www.salimwireless.com
  Interests: Signal Processing, Telecommunication, 5G Technology, Present & Future Wireless Technologies, Digital Signal Processing, Computer Networks, Millimeter Wave Band Channel, Web Development
  Seeking an opportunity in the Teaching or Electronics & Telecommunication domains.
  Possess M.Tech in Electronic Communication Systems.


Contact Us

Name

Email *

Message *

Popular Posts

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...

Modulation Constellation Diagrams BER vs. SNR BER vs SNR for M-QAM, M-PSK, QPSk, BPSK, ... 1. What is Bit Error Rate (BER)? The abbreviation BER stands for bit error rate, which indicates how many corrupted bits are received (after the demodulation process) compared to the total number of bits sent in a communication process. It is defined as,  In mathematics, BER = (number of bits received in error / total number of transmitted bits)  On the other hand, SNR refers to the signal-to-noise power ratio. For ease of calculation, we commonly convert it to dB or decibels.   2. What is Signal the signal-to-noise ratio (SNR)? SNR = signal power/noise power (SNR is a ratio of signal power to noise power) SNR (in dB) = 10*log(signal power / noise power) [base 10] For instance, the SNR for a given communication system is 3dB. So, SNR (in ratio) = 10^{SNR (in dB) / 10} = 2 Therefore, in this instance,...

MATLAB Code for Pulse Width Modulation (PWM) and Demodulation

   Pulse Width Modulation (PWM) MATLAB Script clc; clear all; close all; fs=30; %frequency of the sawtooth signal fm=3; %frequency of the message signal sampling_frequency = 10e3; a=0.5; % amplitide t=0:(1/sampling_frequency):1; %sampling rate of 10kHz sawtooth=2*a.*sawtooth(2*pi*fs*t); %generating a sawtooth wave subplot(4,1,1); plot(t,sawtooth); % plotting the sawtooth wave title('Comparator Wave'); msg=a.*sin(2*pi*fm*t); %generating message wave subplot(4,1,2); plot(t,msg); %plotting the sine message wave title('Message Signal'); for i=1:length(sawtooth) if (msg(i)>=sawtooth(i)) pwm(i)=1; %is message signal amplitude at i th sample is greater than %sawtooth wave amplitude at i th sample else pwm(i)=0; end end subplot(4,1,3); plot(t,pwm,'r'); title('PWM'); axis([0 1 0 1.1]); %to keep the pwm visible during plotting. %% Demodulation % Demodulation: Measure the pulse width to reconstruct the signal demodulated_signal = zeros(size(msg)); for i = 1:leng...

MATLAB Code for ASK, FSK, and PSK

ASK, FSK & PSK HomePage MATLAB Code MATLAB Code for Amplitude Shift Keying (ASK) % The code is written by SalimWireless.Com % Clear previous data and plots clc; clear all; close all; % Parameters Tb = 1; % Bit duration fc = 10; % Carrier frequency N = 10; % Number of bits % Generate carrier signal t = 0:Tb/100:1; carrier_signal = sqrt(2/Tb) * sin(2*pi*fc*t); % Generate message signal rng(10); % Set random seed for reproducibility binary_data = rand(1, N); % Generate random binary data t_start = 0; t_end = Tb; for i = 1:N t = [t_start:0.01:t_end]; % Generate message signal if binary_data(i) > 0.5 binary_data(i) = 1; message_signal = ones(1, length(t)); else binary_data(i) = 0; message_signal = zeros(1, length(t)); end % Store message signal message(i,:) = message_signal; % Modulate message with carrier ...

MATLAB Code for QAM (Quadrature Amplitude Modulation)

  One of the best-performing modulation techniques is QAM [↗] . Here, we modulate the symbols by varying the carrier signal's amplitude and phase in response to the variation in the message signal (or voltage variation). So, we may say that QAM is a combination of phase and amplitude modulation. Additionally, it performs better than ASK or PSK [↗] . In fact, any constellation for any type of modulation, signal set (or, symbols) is structured in a way that prevents them from interacting further by being distinct by phase, amplitude, or frequency. MATLAB Script (for 4-QAM) % This code is written by SalimWirelss.Com % This is an example of 4-QAM. Here constellation size is 4 % or total number of symbols/signals is 4 % We need 2 bits once to represent four constellation points % QAM modulation is the combination of Amplitude modulation plus % Phase Modulation. We map the decimal value of the input symbols, i.e., % 00, 01, 10, 11 to 1 + 1i, -1 + 1i, 1 - 1i, and -1 - 1i, respectively. cl...

Constellation Diagrams of M-ary PSK | M-ary Modulation

Constellation Diagrams QPSK, M-PSK, M-QAM ... What is the difference between Bit and Symbol in the perspective of transmission? Symbols use bandwidth more efficiently than bits. For example, in the case of QPSK, one symbol or signal waveform is represented by 2 bits. Hence symbol rate is one-half of the bit rate. As a result, it occupies half bandwidth compared to the BPSK waveform. We know the primary purpose of modulation [↗] is to multiplex data. Here multiplexing is done so that there is less interference between parallel data streams. Suppose there is a communication channel; we can transmit a single data stream simultaneously. But if we send a symbol instead of a bit, we can send more than 1 bit at a time. In ASK modulation, we assign two amplitude levels to a signal where a higher level is represented by binary '1' and another level as '0'. For BFSK, we apply phase shift in signal (for example, 0 phase shift for consecutive binary ...

Comparisons among ASK, PSK, and FSK | And the definitions of each

Modulation ASK, FSK & PSK Constellation MATLAB Simulink MATLAB Code Comparisons among ASK, PSK, and FSK    Comparisons among ASK, PSK, and FSK Comparison among ASK,  FSK, and PSK Performance Comparison: 1. Noise Sensitivity:    - ASK is the most sensitive to noise due to its reliance on amplitude variations.    - PSK is less sensitive to noise compared to ASK.    - FSK is relatively more robust against noise, making it suitable for noisy environments. 2. Bandwidth Efficiency:    - PSK is the most bandwidth-efficient, requiring less bandwidth than FSK for the same data rate.    - FSK requires wider bandwidth compared to PSK.    - ASK's bandwidth efficiency lies between FSK and PSK. Bandwidth Calculator for ASK, FSK, and PSK The baud rate represents the number of symbols transmitted per second Select Modulation Type: ASK...

Calculation of SNR from FFT bins

  Here, you can find the SNR of a received signal from periodogram / FFT bins using the Kaiser operator. The beta (β) parameter characterizes the Kaiser window, which controls the trade-off between the main lobe width and the side lobe level in the frequency domain. For that you should know the sampling rate of the signal.  The Kaiser window is a type of window function commonly used in signal processing, particularly for designing finite impulse response (FIR) filters and performing spectral analysis. It is a general-purpose window that allows for control over the trade-off between the main lobe width (frequency resolution) and side lobe levels (suppression of spectral leakage). The Kaiser window is defined using a modified Bessel function of the first kind.    Steps Set up the sampling rate and time vector Compute the FFT and periodogram Plot the periodogram using FFT Specify parameters for Kaiser window and periodogram Calculate the frequency resolution and signal...