Skip to main content

Posts

Search

Search Search Any Topic from Any Website Search
Recent posts

Trade-off Between Roll-off Factor and Time Bandwidth Product

  MATLAB Code clc; clear; close all; % Parameters Rb = 1e6; % Bit rate (1 Mbps) SNR_dB = 0:2:20; % SNR range in dB beta_values = [0, 0.2, 0.5, 0.8, 1.0]; % Different roll-off factors numBits = 1e5; % Number of bits disp("For different roll-off (β) factors and a symbol rate of 1 MHz:"); % Simulation BER = zeros(length(beta_values), length(SNR_dB)); for b = 1:length(beta_values) beta = beta_values(b); bandwidth = (1 + beta) * (Rb / 2); % Bandwidth calculation timeBandwidthProduct = (1 + beta) / 2; % Time-bandwidth product calculation fprintf('Beta = %.1f, Bandwidth = %.2f MHz, Time-Bandwidth Product = %.2f\n', beta, bandwidth / 1e6, timeBandwidthProduct); for s = 1:length(SNR_dB) snr = 10^(SNR_dB(s) / 10); % Convert dB to linear EbN0 = snr * Rb / bandwidth; % Adjust for bandwidth noiseVar = 1 / (2 * EbN0); % Transmit random BPSK symbols bits = randi([0, 1], numBits, 1); symbols = 2 * bits - 1; noise = sqrt(noiseVar) * randn(numBits, 1); received = symbols...

Robust Signal Detection with Prefix and Postfix

  MATLAB Code clc; clear; close all; % Parameters fs = 1000; % Sampling frequency msgLength = 100; % Length of the message pnLength = 50; % Length of PN sequence silenceLength = 20; % Length of silence before and after lagAmount = 50; % Amount of lag (can be negative for lead) threshold = 0.5; % Threshold for correlation peak detection % Generate Unique PN Sequences pnPrefix = 2 * (randi([0, 1], 1, pnLength) - 0.5); pnPostfix = 2 * (randi([0, 1], 1, pnLength) - 0.5); % Generate Message originalMessage = (randi([0, 1], 1, msgLength)); message = 2*originalMessage - 1; % Construct Dataframe dataframe = [pnPrefix, message, pnPostfix]; % Introduce Lag or Lead if lagAmount > 0 %laggedFrame = [zeros(1, lagAmount), dataframe(1:end - lagAmount)]; laggedFrame = [zeros(1, lagAmount), dataframe]; else laggedFrame = [dataframe(-lagAmount + 1:end), zeros(1, -lagAmount)]; end % Correlation with PN Sequences corrPrefix = xcorr(laggedFrame, pnPrefix); corrPostfix = xcorr(laggedFrame, pnPostfi...

MATLAB code for MSK

 Copy the MATLAB Code from here % The code is developed by SalimWireless.com clc; clear; close all; % Define a bit sequence bitSeq = [0, 1, 0, 0, 1, 1, 1, 0, 0, 1]; % Perform MSK modulation [modSignal, timeVec] = modulateMSK(bitSeq, 10, 10, 10000); % Plot the modulated signal subplot(2,1,1); samples = 1:numel(bitSeq); stem(samples, bitSeq); title('Original message signal'); xlabel('Time (s)'); ylabel('Amplitude'); % Plot the modulated signal subplot(2,1,2); samples = 1:10000; plot(samples / 10000, modSignal(1:10000)); title('MSK modulated signal'); xlabel('Time (s)'); ylabel('Amplitude'); % Perform MSK demodulation demodBits = demodMSK(modSignal, 10, 10, 10000); % Function to perform MSK modulation function [signal, timeVec] = modulateMSK(bits, carrierFreq, baudRate, sampleFreq) % Converts a binary bit sequence into an MSK-modulated signal % Inputs: % bits - Binary input sequence % carrierFreq - Carri...

MATLAB Code for Pulse Position Modulation (PPM) and Demodulation

  MATLAB Code % Set parameters fs = 1000; % Sampling rate in Hz t = 0:1/fs:1; % Time vector spanning 1 second analogSignal = (sin(2 * pi * 2 * t) + 1) / 2; % Generate a 2 Hz sine wave, scaled to [0,1] samplesPerPulse = 100; % Define number of samples per pulse ppmWidthFraction = 0.1; % Fraction of samplesPerPulse used for pulse width % Perform PPM modulation [ppmSignal, ppmPulseTrain] = ppmModulate(analogSignal, samplesPerPulse, ppmWidthFraction); % Perform PPM demodulation demodulatedSignal = ppmDemodulate(ppmSignal, samplesPerPulse); % Display the demodulated signal values disp('Demodulated Signal:'); disp(demodulatedSignal); % Plot results figure; % Plot original analog signal subplot(3, 1, 1); plot(t, analogSignal, 'b'); title('Original 2 Hz Sine Wave'); xlabel('Time (s)'); ylabel('Amplitude'); % Plot modulated PPM signal subplot(3, 1, 2); stem(ppmSignal(1:1000), 'filled'); title('Pulse Position Modulated (PPM) Signal'); xlabe...

Add AWGN Directly to PSD in MATLAB

  In general, we compute the power spectral density (PSD) of a noisy periodic signal. However, in this article, you will learn how to add noise directly to the PSD of a signal. This process is approximately equivalent to adding noise to a clean signal and then computing its PSD. Here, I will discuss both the theoretical background and the MATLAB implementation. Steps 1. First, compute the Fast Fourier Transform (FFT) of the clean signal. Then, calculate the Power Spectral Density (PSD) from the FFT. 2. In our case, ensure that the PSD is in the linear scale . Next, compute the noise power from the given Signal-to-Noise Ratio (SNR) using: noise_power = signal power / linear SNR 3. Then, generate Additive White Gaussian Noise (AWGN) using the formula: AWGN noise = sqrt(noise_power) * randn       where randn generates a Gaussian-distributed signal with a mean of 0 and a variance of 1 .   MATLAB Co...

MATLAB code for GMSK

  Copy the MATLAB code from here  % The code is developed by SalimWireless.com clc; clear; close all; % Parameters samples_per_bit = 36; bit_duration = 1; num_bits = 20; sample_interval = bit_duration / samples_per_bit; time_vector = 0:sample_interval:(num_bits * bit_duration); time_vector(end) = []; % Generate and modulate binary data binary_data = randi([0, 1], 1, num_bits); modulated_bits = 2 * binary_data - 1; upsampled_signal = kron(modulated_bits, ones(1, samples_per_bit)); figure; plot(time_vector, upsampled_signal); title('Message Signal'); % Apply Gaussian filter filtered_signal = conv(GMSK_gaussian_filter1(bit_duration, samples_per_bit), upsampled_signal); filtered_signal = [filtered_signal, filtered_signal(end)]; figure; plot(filtered_signal); title('Filtered Signal'); % Integration & GMSK modulation integrated_signal = cumsum(filtered_signal); gmsk_signal = exp(1i * integrated_signal); % Plotting the real and imaginary parts of the GMSK signal ...

Pulse Width Modulation (PWM)

Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a method of controlling the average power delivered by an electrical signal.   Fig: An example of PWM in an idealized inductor driven by a blue line voltage source modulated as a series of sawtooth pulses, resulting in a red line current in the inductor.    Duty cycle A low duty cycle equates to low power because the power is off for most of the time; the word duty cycle reflects the ratio of "on" time to the regular interval or "period" of time. The duty cycle is measured in percent, with 100% representing full on. A digital signal has a duty cycle of 50% and looks like a "square" wave when it is on 50% of the time and off the other 50%. A digital signal has a duty cycle of greater than 50% when it spends more time in the on state than the off state. A digital signal has a duty cycle of 50% when it alternates between the on and off states more often than not.         Mathematical...

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 *