Skip to main content

MATLAB Code for Delta Modulation (DM) and Demodulation


 

MATLAB Script 

clc;
clear all;
close all;

fs = 10000;
fm = 100;
t = 0:1/fs:1000/fs; % Time Duration = 1000/10000 = 0.1 second
x = 5*sin(2*pi*100*t); % Define Message Signal with peak voltage 5V and frequency 100Hz

plot(t, x);
hold on

y = [0]; % Output DM signal i.e. stream of 1 or 0
xr = 0; % Output of Integrator i.e. staircase approximation; initial value = 0
del = 0.4; % Stepsize

for i = 1:length(x)-1
if xr(i) <= x(i) % If current sample greater than the previous values or output of the integrator, output of DM = 1
d = 1;
xr(i+1) = xr(i) + del; % Staircase approximated value
else
d = 0;
xr(i+1) = xr(i) - del; % If current sample less than the previous values or output of the integrator, output of DM = 0
end
y = [y d];
end

stairs(t, xr); % Show the staircase approximated signal
title('Staircase Approximated Signal');
hold off

MSE = sum((x - xr).^2) / length(x); % Mean Squared Error (MSE)
disp(['Mean Squared Error (MSE): ', num2str(MSE)]);

figure;

% Delta Modulation
subplot(3, 1, 1);
plot(t,y); % Show the staircase approximated signal
title('Delta Modulated Signal');

% Delta Demodulation
subplot(3, 1, 2);
y_demod = [0];
xr_demod = 0;

for i = 2:length(y)
if y(i) == 1
xr_demod = xr_demod + del;
else
xr_demod = xr_demod - del;
end
y_demod = [y_demod xr_demod];
end

plot(t, y_demod);
title('Delta Demodulated Signal (Before Filtering)');

% Apply Low-Pass Filter
filter_order = 20;
lowpass_filter = fir1(filter_order, fm/(fs/2), 'low');
filtered_demod_signal = filter(lowpass_filter, 1, y_demod);

% Plot the filtered demodulated signal
subplot(3, 1, 3);
plot(t, filtered_demod_signal);
title('Filtered Demodulated Signal');

 

Output 

 

 
 



Copy the MATLAB Code from here

 

 

 

Read more about

  1.  Pulse Amplitude Modulation (PAM) and Demodulation
  2. Pulse Width Modulation (PWM) and Demodulation
  3. Pulse Position Modulation (PPM) and Demodulation
  4. Delta Modulation and demodulation
  5. Pulse Code Modulation (PCM)
  6. Quantization Signal to Noise Ration (Q-SNR)
  7. MATLAB Code for Pulse Amplitude Modulation and Demodulation
  8. MATLAB Code for Pulse Width Modulation and Demodulation
  9. MATLAB Code for Pulse Code Modulation (PCM) and demodulation

People are good at skipping over material they already know!

View Related Topics to







Contact Us

Name

Email *

Message *

Popular Posts

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...(MATLAB Code + Simulator)

Bit Error Rate (BER) & SNR Guide Analyze communication system performance with our interactive simulators and MATLAB tools. ๐Ÿ“˜ Theory ๐Ÿงฎ Simulators ๐Ÿ’ป MATLAB Code ๐Ÿ“š Resources BER Definition SNR Formula BER Calculator MATLAB Comparison ๐Ÿ“‚ Explore M-ary QAM, PSK, and QPSK Topics ▼ ๐Ÿงฎ Constellation Simulator: M-ary QAM ๐Ÿงฎ Constellation Simulator: M-ary PSK ๐Ÿงฎ BER calculation for ASK, FSK, and PSK ๐Ÿงฎ Approaches to BER vs SNR What is Bit Error Rate (BER)? The BER indicates how many corrupted bits are received compared to the total number of bits sent. It is the primary figure of merit for a...

Online Simulator for ASK, FSK, and PSK

Try our new Digital Signal Processing Simulator!   •   Interactive ASK, FSK, and BPSK tools updated for 2025. Start Now Interactive Modulation Simulators Visualize binary modulation techniques (ASK, FSK, BPSK) in real-time with adjustable carrier and sampling parameters. ๐Ÿ“ก ASK Simulator ๐Ÿ“ถ FSK Simulator ๐ŸŽš️ BPSK Simulator ๐Ÿ“š More Topics ASK Modulator FSK Modulator BPSK Modulator More Topics Simulator for Binary ASK Modulation Digital Message Bits Carrier Freq (Hz) Sampling Rate (...

Constellation Diagrams of ASK, PSK, and FSK (with MATLAB Code + Simulator)

Constellation Diagrams: ASK, FSK, and PSK Comprehensive guide to signal space representation, including interactive simulators and MATLAB implementations. ๐Ÿ“˜ Overview ๐Ÿงฎ Simulator ⚖️ Theory ๐Ÿ“š Resources Definitions Constellation Tool Key Points MATLAB Code ๐Ÿ“‚ Other Topics: M-ary PSK & QAM Diagrams ▼ ๐Ÿงฎ Simulator for M-ary PSK Constellation ๐Ÿงฎ Simulator for M-ary QAM Constellation BASK (Binary ASK) Modulation Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1. BFSK (Binary FSK) Modulation Transmits one ...

Online Simulator for Frequency Modulatiuon

Frequency Modulation Message Frequency (Hz): Generate Message Carrier Frequency (Hz): Generate Carrier Message Signal Amplitude: Carrier Signal Amplitude: Generate Modulated Signal Demodulate Further Reading  Amplitude Modulation Simulator Phase Modulation Simulator  Explore DSP Simulations   Online Signal Processing Simulations Home Page >

Time / Frequency Separation for Orthogonality

๐Ÿ“˜ Theory ๐Ÿ“ Derivation ๐Ÿ“Š Examples ๐Ÿงฎ Simulator Try the Interactive BFSK / FM Simulator Visualize modulation and understand concepts faster. Launch BFSK Simulator Launch FM Simulator BFSK Orthogonality Simulator Derivation of Frequency Separation for Orthogonality Step 1: Define BFSK Signals Copy s₁(t) = √(2E b /T) cos(2ฯ€f₁t) Copy s₂(t) = √(2E b /T) cos(2ฯ€f₂t) Defined over: 0 ≤ t ≤ T For orthogonality: Copy ∫₀แต€ s₁(t)s₂(t) dt = 0 Step 2: Remove Constants Copy ∫₀แต€ cos(2ฯ€f₁t) cos(2ฯ€f₂t) dt = 0 Step 3: Use Trigonometric Identity Copy cos A cos B = ½ [ cos(A − B) + cos(A + B) ] Applying identity: Copy ½ ∫₀แต€ [ cos(2ฯ€(f₁ − f₂)t) + cos(2ฯ€(f₁ + f₂)t) ] dt Ste...

UGC NET Electronic Science Previous Year Question Papers

Home / Engineering & Other Exams / UGC NET 2022 PYQ ๐Ÿ“ฅ Download UGC NET Electronics PDFs Complete collection of previous year question papers, answer keys and explanations for Subject Code 88. Start Downloading UGC-NET (Electronics Science, Subject code: 88) Subject_Code : 88; Department : Electronic Science; ๐Ÿ“‚ View All Question Papers UGC Net Electronic Science Question Paper With Answer Key Download Pdf [June 2025] with full explanation UGC Net Electronic Science Question Paper With Answer Key Download Pdf [December 2024] UGC Net Paper 1 With Answer Key Download Pdf [Sep 2024] with full explanation UGC Net Electronic Science Question Paper With Answer Key Download Pdf [Aug 2024] with full explanation UGC Net Paper 1 With Answer Key Download...

FM Modulation Online Simulator

Frequency Modulation Simulator Message Frequency (fm): Hz Carrier Frequency (fc): Hz Carrier Amplitude (Ac): Modulation Index (ฮฒ): Frequency deviation ฮ”f = ฮฒ × fm Online Signal Processing Simulations Home Page >

Comparisons among ASK, PSK, and FSK (with MATLAB + Simulator)

๐Ÿ“˜ Comparisons among ASK, FSK, and PSK ๐Ÿงฎ Online Simulator for calculating Bandwidth of ASK, FSK, and PSK ๐Ÿงฎ MATLAB Code for BER vs. SNR Analysis of ASK, FSK, and PSK ๐Ÿ“š Further Reading ๐Ÿ“‚ View Other Topics on Comparisons among ASK, PSK, and FSK ... ๐Ÿงฎ Comparisons of Noise Sensitivity, Bandwidth, Complexity, etc. ๐Ÿงฎ MATLAB Code for Constellation Diagrams of ASK, FSK, and PSK ๐Ÿงฎ Online Simulator for ASK, FSK, and PSK Generation ๐Ÿงฎ Online Simulator for ASK, FSK, and PSK Constellation ๐Ÿงฎ Some Questions and Answers 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 Parameters ASK FSK PSK Variable Characteristics Amplitude Frequency ...