Skip to main content

Fourier Differentiation Property in MATLAB

 

Fourier Differentiation Property

The Fourier transform of a time-domain signal is defined as follows
 

Fourier Differentiation Property

 

MATLAB Code for Fourier Differentiation property of a Sine Function

clc;
clear;
close all;
 
% Parameters
fs = 1000; % Sampling frequency (Hz)
T = 1; % Duration of the signal (seconds)
f = 50; % Frequency of the sine wave (Hz)
A = 1; % Amplitude of the sine wave

% Time vector
t = 0:1/fs:T-1/fs;

% Generate sine wave
x = A * sin(2*pi*f*t);

% Compute Fourier Transform
X = fft(x);

% Frequency vector
N = length(x);
frequencies = (0:N-1)*(fs/N);

% Apply differentiation property in frequency domain
jw = 1i * 2 * pi * frequencies; % jω term for differentiation

% Multiply Fourier coefficients by jω
dX = jw .* X;

% Compute Inverse Fourier Transform for differentiated signal
dx = ifft(dX);

% Plotting
figure;

% Plot original signal and its magnitude spectrum
subplot(3,1,1);
plot(t, x);
title('Original Sine Wave');
xlabel('Time (s)');
ylabel('Amplitude');

subplot(3,1,2);
plot(frequencies, abs(X));
title('Magnitude of Fourier Transform (Original)');
xlabel('Frequency (Hz)');
ylabel('Magnitude');

% Plot differentiated signal and its magnitude spectrum
subplot(3,1,3);
plot(t, real(dx));
title('Differentiated Signal');
xlabel('Time (s)');
ylabel('Amplitude');

% Compute Fourier Transform of differentiated signal
dX_fft = fft(dx);

% Plot magnitude spectrum of differentiated signal
figure;
plot(frequencies, abs(dX_fft));
title('Magnitude of Fourier Transform (Differentiated)');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
 

Output

 
 
 
 

 

Copy the MATLAB Code from here

 

MATLAB Script (for a Gaussian function)

clc;
clear;
close all;

% Parameters
N = 256; % Number of samples
T = 1; % Total duration (s)
t = linspace(0, T, N); % Time vector
mean_val = 0.5 * T; % Mean of the Gaussian
std_dev = 0.1 * T; % Standard deviation of the Gaussian

% Gaussian signal
signal = exp(-0.5 * ((t - mean_val) / std_dev) .^ 2);

% Fourier Transform
Xomega = fft(signal);

% Frequencies
frequencies = (0:N-1) * (1/T);

% Apply Fourier Differentiation Property
omega = 2 * pi * frequencies;
jOmegaXomega = 1i * omega .* Xomega;

% Magnitude of the output signal in the frequency domain
output_magnitude = abs(jOmegaXomega);

% Plot input signal in time domain
figure;
subplot(2, 1, 1);
plot(t, signal, 'LineWidth', 1.5);
title('Input Gaussian Signal');
xlabel('Time (s)');
ylabel('Amplitude');

% Plot output signal in frequency domain
subplot(2, 1, 2);
plot(frequencies, output_magnitude, 'LineWidth', 1.5);
title('Output Signal |j\omega X(\omega)| in Frequency Domain');
xlabel('Frequency (Hz)');
ylabel('Magnitude'); 

 

Output 




Copy the MATLAB Code from here

 

 

Another Example

 clc;
clear;
close all;

% Main Script

% Example input signal x(t)
signal = [1, 2, 3, 4];

% Compute Fourier Transform and apply differentiation property
[Xomega, frequencies] = fourierTransform(signal);
jOmegaXomega = applyDifferentiationProperty(Xomega, frequencies);

% Prepare data for input signal plot
inputSignalX = 0:length(signal)-1;
inputSignalY = signal;

% Prepare data for output signal plot
outputSignalX = frequencies;
outputSignalY = abs(jOmegaXomega);

% Plot input signal
figure;
subplot(2, 1, 1);
plot(inputSignalX, inputSignalY, 'LineWidth', 1.5);
title('Input Signal x(t)');
xlabel('Index');
ylabel('Amplitude');

% Plot output signal
subplot(2, 1, 2);
plot(outputSignalX, outputSignalY, 'LineWidth', 1.5);
title('Output Signal after Applying Fourier Transform Differentiation Property');
xlabel('Frequency (\omega)');
ylabel('Magnitude');

% Function Definitions

% Compute Fourier Transform of input signal x(t)
function [Xomega, frequencies] = fourierTransform(xt)
    N = length(xt);
    Xomega = fft(xt);  % Using inbuilt fft function
    frequencies = 2 * pi * (0:N-1) / N;
end

% Differentiation property in frequency domain: F(dx(t)/dt) = jω X(ω)
function differentiated = applyDifferentiationProperty(Xomega, frequencies)
    differentiated = complex(zeros(1, length(Xomega)));
    for k = 1:length(Xomega)
        omega = frequencies(k);
        differentiated(k) = 1i * omega * Xomega(k);
    end
end
 

Output 

 

 

Copy the MATLAB Code from here

 

 

Also read about

[1] FFT Magnitude and Phase Spectrum using MATLAB

People are good at skipping over material they already know!

View Related Topics to







Admin & Author: Salim

s

  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

Constellation Diagrams of ASK, PSK, and FSK

📘 Overview of Energy per Bit (Eb / N0) 🧮 Online Simulator for constellation diagrams of ASK, FSK, and PSK 🧮 Theory behind Constellation Diagrams of ASK, FSK, and PSK 🧮 MATLAB Codes for Constellation Diagrams of ASK, FSK, and PSK 📚 Further Reading 📂 Other Topics on Constellation Diagrams of ASK, PSK, and FSK ... 🧮 Simulator for constellation diagrams of m-ary PSK 🧮 Simulator for constellation diagrams of m-ary QAM 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 of two signals: +√Eb​ ( On the y-axis, the phase shift of 90 degrees with respect to the x-axis, which is also termed phase offset ) or √Eb (on x-axis), where Eb​ is the energy per bit. These signals represent binary 0 and 1.  BPSK (Binary PSK) Modulation: Transmits one of two signals...

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

📘 Overview of QAM 🧮 MATLAB Code for m-ary QAM (4-QAM, 16-QAM, 32-QAM, ...) 🧮 Online Simulator for M-ary QAM Constellations 📚 Further Reading 📂 Other Topics on Constellation Diagrams of QAM configurations ... 🧮 MATLAB Code for 4-QAM 🧮 MATLAB Code for 16-QAM 🧮 MATLAB Code for m-ary QAM (4-QAM, 16-QAM, 32-QAM, ...) 🧮 Simulator for constellation diagrams of m-ary PSK 🧮 Simulator for constellation diagrams of m-ary QAM 🧮 Overview of Energy per Bit (Eb / N0) 🧮 Online Simulator for constellation diagrams of ASK, FSK, and PSK 🧮 Theory behind Constellation Diagrams of ASK, FSK, and PSK 🧮 MATLAB Codes for Constellation Diagrams of ASK, FSK, and PSK QAM Unlike M-ary PSK, where the signal is modulated with diff...

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

📘 Overview of BER and SNR 🧮 Online Simulator for BER calculation of m-ary QAM and m-ary PSK 🧮 MATLAB Code for BER calculation of M-ary QAM, M-ary PSK, QPSK, BPSK, ... 📚 Further Reading 📂 View Other Topics on M-ary QAM, M-ary PSK, QPSK ... 🧮 Online Simulator for Constellation Diagram of m-ary QAM 🧮 Online Simulator for Constellation Diagram of m-ary PSK 🧮 MATLAB Code for BER calculation of ASK, FSK, and PSK 🧮 MATLAB Code for BER calculation of Alamouti Scheme 🧮 Different approaches to calculate BER vs SNR 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 ...

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

📘 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   Simulator for Calculating Bandwidth of ASK, FSK, and PSK The baud rate represents the number of symbols transmitted per second. Both baud rate and bit rate a...

MATLAB Code for Zero-Forcing (ZF) Beamforming in 4×4 MIMO Systems

MATLAB Code for Zero-Forcing (ZF) Beamforming in 4×4 MIMO Systems clc; clear; close all; %% Parameters Nt = 4; % Transmit antennas Nr = 4; % Receive antennas (must be >= Nt for ZFBF) numBits = 1e4; % Number of bits per stream SNRdB = 0; % SNR in dB numRuns = 100; % Number of independent runs for averaging %% Precompute noise standard deviation noiseSigma = 10^(-SNRdB / 20); %% Accumulator for total errors totalErrors = 0; for run = 1:numRuns % Generate random bits: [4 x 10000] bits = randi([0 1], Nt, numBits); % BPSK modulation: 0 → +1, 1 → -1 txSymbols = 1 - 2 * bits; % Rayleigh channel matrix: [4 x 4] H = (randn(Nr, Nt) + 1j * randn(Nr, Nt)) / sqrt(2); %% === Zero Forcing Beamforming at Transmitter === W_zf = pinv(H); % Precoding matrix: [Nt x Nr] txPrecoded = W_zf * txSymbols; % Apply ZF precoding % Normalize transmit power (optional but useful) txPrecoded = txPrecoded / sqrt(mean(abs(txPrecoded(:)).^2)); %% Channel transmission with AWGN noise = noiseSigma * (randn(...

Constellation Diagram of FSK in Detail

📘 Overview 🧮 Simulator for constellation diagram of FSK 🧮 Theory 🧮 MATLAB Code 📚 Further Reading   Binary bits '0' and '1' can be mapped to 'j' and '1' to '1', respectively, for Baseband Binary Frequency Shift Keying (BFSK) . Signals are in phase here. These bits can be mapped into baseband representation for a number of uses, including power spectral density (PSD) calculations. For passband BFSK transmission, we can modulate signal 'j' with a lower carrier frequency and signal '1' with a higher carrier frequency while transmitting over a wireless channel. Let's assume we are transmitting carrier signal fc1 for the transmission of binary bit '1' and carrier signal fc2 for the transmission of binary bit '0'. Simulator for 2-FSK Constellation Diagram Simulator for 2-FSK Constellation Diagram SNR (dB): ...

How Windowing Affects Your Periodogram

The windowed periodogram is a widely used technique for estimating the Power Spectral Density (PSD) of a signal. It enhances the classical periodogram by mitigating spectral leakage through the application of a windowing function. This technique is essential in signal processing for accurate frequency-domain analysis.   Power Spectral Density (PSD) The PSD characterizes how the power of a signal is distributed across different frequency components. For a discrete-time signal, the PSD is defined as the Fourier Transform of the signal’s autocorrelation function: S x (f) = FT{R x (τ)} Here, R x (τ)}is the autocorrelation function. FT : Fourier Transform   Classical Periodogram The periodogram is a non-parametric PSD estimation method based on the Discrete Fourier Transform (DFT): P x (f) = \(\frac{1}{N}\) X(f) 2 Here: X(f): DFT of the signal x(n) N: Signal length However, the classical periodogram suffers from spectral leakage due to abrupt truncation of the ...

Coherence Bandwidth and Coherence Time

🧮 Coherence Bandwidth 🧮 Coherence Time 🧮 Coherence Time Calculator 🧮 Relationship between Coherence Time and Delay Spread 🧮 MATLAB Code to find Relationship between Coherence Time and delay Spread 📚 Further Reading   Coherence Bandwidth Coherence bandwidth is a concept in wireless communication and signal processing that relates to the frequency range over which a wireless channel remains approximately constant in terms of its characteristics. coherence bandwidth is  The inverse of Doppler spread delay time, or any spread delay time due to fading in general.  The coherence bandwidth is related to the delay spread of the channel, which is a measure of the time it takes for signals to traverse the channel. The two are related by the following formulae: Coherence bandwidth = 1/(delay spread time) Or, Coherence Bandwidth = 1/(root-mean-square delay spread time) (Coherence bandwidth in Hertz) For instance, the coherence bandwidth is...