Skip to main content

How to normalize a highly distorted signal


 

Signal normalization is a common practice in signal processing, especially after a signal has undergone filtering. For example, when using an FIR low-pass filter during the demodulation process of a modulated signal—such as AM or DSB-SC demodulation—you may observe that the first few samples of the demodulated signal exhibit significant transients due to the filtering effect. This occurs because the filter requires approximately N past input samples to produce a steady-state or valid output. To correct for amplitude attenuation, the filtered signal can be normalized to a standard range, such as -1 to 1

 

MATLAB Script

% Parameters for the sine wave
fs = 1000; % Sampling frequency
t = 0:1/fs:1; % Time vector
f = 15; % Frequency of the sine wave

% Example signal: Noisy sine wave
filtered_signal = 0.03*sin(2 * pi * f * t) + 0.05*sin(2 * pi * f * t);
% Step 2: Normalize the filterd signal to the range [-1, +1]
normalized_signal = (filtered_signal - min(filtered_signal)) / (max(filtered_signal) - min(filtered_signal));
normalized_signal = normalized_signal * 2 - 1; % Scale to [-1, +1]


% Original Signal
figure();
plot(t, filtered_signal, 'b', 'LineWidth', 1.5);
title('Filtered Signal');
xlabel('Time (s)');
ylabel('Amplitude');
ylim([-0.1 0.1]);
grid on;

% Normalized Signal
figure();
plot(t, normalized_signal, 'g', 'LineWidth', 1.5);
title('Normalized Signal [-1, +1]');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;

Output








 

 

Copy the MATLAB Code from here 

 


 

Normalize a Highly distorted filtered signal

When normalizing a filtered signal, you may observe that the initial data points are often highly distorted, while the remainder of the signal appears stable. Therefore, it's recommended to discard the first N points (where N is the filter order) before performing normalization.

 

MATLAB script for normalizing a highly distorted filtered signal, where the first few samples are highly transient due to filtering effects

 
 % Parameters for the sine wave
fs = 1000; % Sampling frequency
t = 0:1/fs:1; % Time vector
t1 = N/fs:1/fs:1;
f = 15; % Frequency of the sine wave

% Example signal: Noisy sine wave
filtered_signal = 0.03*sin(2 * pi * f * t) + 0.05*sin(2 * pi * f * t);

N = 10; % N = Filter order
signal1 = filtered_signal(1:N) * 15;
signal2 = filtered_signal(N+1:end);

filtered_signal = [signal1 signal2];


% Normalize the filterd signal to the range [-1, +1] without discarding
% first N-points (N = order of filter)
normalized_signal = (filtered_signal - min(filtered_signal)) / (max(filtered_signal) ...
- min(filtered_signal));
normalized_signal = normalized_signal * 2 - 1; % Scale to [-1, +1]

% Normalize the filterd signal to the range [-1, +1]
normalized_signal1 = (filtered_signal(N+1:end) - min(filtered_signal(N+1:end))) / (max(filtered_signal(N+1:end)) ...
- min(filtered_signal(N+1:end)));
normalized_signal1 = normalized_signal1 * 2 - 1; % Scale to [-1, +1]


% Original Signal
figure();
plot(t, filtered_signal, 'b', 'LineWidth', 1.5);
title('Highly Distorted Filtered Signal');
xlabel('Time (s)');
ylabel('Amplitude');
ylim([-1 1]);
grid on;

% Normalized Signal
figure();
plot(t, normalized_signal, 'g', 'LineWidth', 1.5);
title('Normalized Signal [-1, +1] without discarding first N-points');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;

% Normalized Signal
figure();
plot(t1, normalized_signal1, 'g', 'LineWidth', 1.5);
title('Normalized Signal [-1, +1]');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;

Output 

 
















 Suppose we are using a filter of order N (e.g., 200), which uses N+1 taps (for FIR). The filter requires approximately N past input samples to produce a steady-state or valid output. Therefore, the first N or so samples are based on incomplete data, leading to startup transients. Discarding the first N samples is thus a conservative and practical way to avoid these artifacts.

Further Reading

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...

Hybrid Beamforming | Page 2

Beamforming Techniques Hybrid Beamforming... Page 1 | Page 2 | clear all; close all; clc; Nt = 64; Nr = 16; NtRF = 4; NrRF = 4; At both the transmitter and receiver ends, there are four RF chains only for a hybrid beamforming system. Alternatively, every 16 antenna elements on the transmitter side is connected to a single RF chain, while every 4 antenna elements on the receiver side are connected to a single RF chain. Mixers, amplifiers, and other critical wireless communication components make up the RF chain. Now, in the case of hybrid beamforming, there can be four different data streams between the transmitter and receiver, as both sides have four RF chains, each of which is accountable for a separate data stream. For Analog Beamforming: All 64 Tx antenna elements create a beam or focus the resultant correlated signal spread from adjacent antennas to a particular direction. Similarly, it may be used for beam...

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): ...

Theoretical BER vs SNR for binary ASK and FSK

๐Ÿ“˜ Overview & Theory ๐Ÿงฎ MATLAB Codes ๐Ÿ“š Further Reading Theoretical Ber vs SNR for Amplitude Shift Keying (ASK) The theoretical bit error rate (BER) for binary Amplitude Shift Keying (ASK) as a function of the signal-to-noise ratio (SNR) can be derived using the following expression: If we map the binary signals to 1 and -1 in ASK , the probability of bit error will be: BER = Q(√(2*SNR))   If we map the binary signals to 0 and 1 in ASK , the probability of bit error will be:    BER = Q(√(SNR/2))   Where: Q(x) is the Q-function, which is the tail probability of the standard normal distribution. SNR is the signal-to-noise ratio. N0 is the noise power spectral density. Where Q is the Q function In mathematics Q(x) = 0.5 * erfc(x/ √ 2)   Calculate the Probability of Error using Q-function for ASK: For ASK with amplitudes 0 and 1 : When bit '0' is transmitted, the received signal is noise only . When bit '1' is transmitted, the re...

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...

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 ...

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 ...