Professional Documents
Culture Documents
Attaphongse Taparugssanagorn - Classical Signal Processing and Non-Classical Signal Processing - The Rhythm of Signals-Cambridge Scholars Publishing (2023)
Attaphongse Taparugssanagorn - Classical Signal Processing and Non-Classical Signal Processing - The Rhythm of Signals-Cambridge Scholars Publishing (2023)
Attaphongse Taparugssanagorn - Classical Signal Processing and Non-Classical Signal Processing - The Rhythm of Signals-Cambridge Scholars Publishing (2023)
Processing
and Non-Classical
Signal Processing:
By
Attaphongse Taparugssanagorn
Classical Signal Processing and Non-Classical Signal Processing:
The Rhythm of Signals
By Attaphongse Taparugssanagorn
All rights for this book reserved. No part of this book may be reproduced,
stored in a retrieval system, or transmitted, in any form or by any means,
electronic, mechanical, photocopying, recording or otherwise, without
the prior permission of the copyright owner.
Chapter I ..................................................................................................... 1
Introduction
Chapter II .................................................................................................... 7
Classical Signal Processing
INTRODUCTION
What sets this book apart is its unique perspective on presenting these
concepts. It demonstrates how signals can be made sexy and valuable
through the application of diverse signal processing techniques. It
showcases signal processing as a powerful tool for extracting new
information, transforming signals from mundane to captivating.
Moreover, as a bonus, the author, known for their talent as a rap rhyme
composer, provides entertaining rap rhyme summaries at the end of each
chapter. This unique addition allows readers to relax and enjoy a rhythmic
recap after engaging with the complex material. Additionally, the author
provides layman's explanations throughout the book, ensuring that readers
without a technical background can grasp the concepts.
a)
b)
4 Chapter I
c)
Figure 1-1: Different types of signals, including a) sound waves, b) images or 2-D
signal, and c) biological signals, e.g., ECG signal (right).
Classical techniques like Fourier and filters are still essential and time and
frequency domains are signal processing fundamentals.
However, new techniques like wavelets and machine learning are emerging,
With a fresh approach and a mix of theory and practice, it is the perfect
guide. To understand classical and non-classical signal processing
techniques and ride high.
Layman’s guide:
In simple terms, the introduction chapter is all about signals and how they
are processed. Signals can be different types of things like sound waves,
images, or biological data. Signal processing is important because it helps
us understand and make sense of these signals.
There are classical techniques that have been used for a long time, like
Fourier analysis and filters. These techniques are still really important in
understanding signals in terms of time and frequency.
But there are also newer techniques like wavelets and machine learning that
are emerging. These techniques make signal processing more exciting and
add complexity to the science behind it.
Signals are physical phenomena that vary over time or space and can be
represented mathematically as functions. Amplitude, frequency, and phase
are three fundamental concepts of signals. Amplitude refers to the
magnitude of a signal, which represents the strength of the signal.
Frequency is the number of cycles per unit of time, and it determines the
pitch of the signal. Phase is the position of a waveform relative to a fixed
reference point in time.
Signals can be classified into two main types: analog and digital signals.
Analog signals are continuous-time signals that vary smoothly over time
and can take any value within a range. On the other hand, digital signals are
discrete-time signals that have a finite set of possible values.
There are different types of signal spectra that can be derived from the
Fourier transform. Power spectral density (PSD) is a measure of the power
of a signal at each frequency. Energy spectral density (ESD) is a measure
Classical Signal Processing 9
of the energy of a signal at each frequency. The PSD and ESD are essential
tools for characterizing signals and are widely used in various fields,
including communication systems, audio processing, and image processing.
Figure 2-1: An example of a sinusoidal signal ݂ሺݐሻ = ܣsin(2ߨ݂)ݐ, where A=1 and
f= 10 Hz and its Fourier transform.
10 Chapter II
This example highlights the Dirichlet's condition for the existence of the
Fourier transform. According to Dirichlet's condition, a periodic function
must satisfy certain requirements in order for its Fourier transform to exist.
These conditions ensure that the function has a finite number of
discontinuities, finite number of extrema, and finite total variation within a
given period. In the case of the sinusoidal signal described, it satisfies
Dirichlet's condition, allowing its Fourier transform to be represented by the
unit impulse, indicating the presence of a single frequency component.
Signals can be classified into two main types: analog and digital signals.
Analog signals are continuous-time signals that vary smoothly over time
and can take any value within a range. Mathematically, they are represented
as functions of continuous variables. On the other hand, digital signals are
discrete-time signals that have a finite set of possible values. They are
represented as a sequence of numbers.
ଵ
ܲܵ = )߱(ܦlim ||)߱(ܨଶ , (2)
்՜ஶ ்
where )߱(ܨis the Fourier transform of the signal and ܶ is the observation
time.
Both PSD and ESD are essential tools for characterizing signals and are
widely used in various fields, including communication systems, audio
processing, and image processing.
Let me break it down for you, listen close. We are diving into Fourier
analysis, a powerful dose. Signals and their spectra, we are going to explore,
in the frequency domain, we will uncover more.
First, let us talk signals, they are quite profound. Amplitude, frequency, and
phase, all around. Amplitude's the strength, the magnitude you see,
Frequency determines pitch, cycles per unit, it is key. Phase tells us the
position in time, it is neat. With these concepts, signals become complete.
These spectra are crucial, you know they are grand, in communication,
audio, and image land. They help us analyze and process signals with flair.
Understanding their characteristics, beyond compare.
12 Chapter II
So, wrap it up, Fourier transform is the key. With amplitude, frequency,
phase, you see. Analog, digital, their differences profound, PSD and ESD,
spectra that astound.
Now you know the signals and their flow, Fourier analysis, it is time to let
it show. Understanding signals and their spectra is a must. With these tools,
you conquer, there is no doubt you will thrust.Top of Form
Key takeaways from the Fourier analysis and signal spectra section are
given as follows:
Layman’s guide:
Let me break it down for you in simple terms. We are going to explore
Fourier analysis, a powerful tool for understanding signals and their spectra
in the frequency domain.
There are two types of signals we commonly encounter: analog and digital.
Analog signals are continuous and flow smoothly, while digital signals are
discrete and have a set of specific values. Digital signals are often
represented as a sequence.
Now, let us talk about the Fourier transform. It is like a magical journey that
takes signals into the frequency domain. The Fourier transform represents
signals in terms of their frequency components. It involves integrating the
signal with exponential functions raised to a power.
We also have two important measures: power spectral density (PSD) and
energy spectral density (ESD). PSD measures the power of a signal at
different frequencies, providing detailed information about signal power.
ESD measures the energy of a signal at different frequencies, giving us
insights into its energy distribution.
These spectra are crucial in various fields like communication, audio, and
image processing. They help us analyze and process signals with expertise.
By understanding the characteristics of signals through their spectra, we
gain valuable insights that are unmatched.
To sum it up, the Fourier transform is the key tool in this journey. It allows
us to analyze signals using their amplitude, frequency, and phase. We also
learn about the differences between analog and digital signals, as well as the
significance of PSD and ESD.
Solution: Fourier analysis can be used to decompose a music signal into its
constituent frequencies. By applying the Fourier transform to the music
signal, we can obtain the frequency spectrum, which represents the
amplitudes of different frequencies present in the signal. By analyzing the
frequency spectrum, we can identify the dominant frequencies, which
correspond to the main musical notes or tones in the music signal.
14 Chapter II
MATLAB example:
Step 2: Compute the Fourier transform of the music signal using fast
Fourier transform (FFT) command fft.
Note that FFT is a specific algorithm used to compute the Discrete Fourier
Transform (DFT) of a sequence or signal. The DFT is a mathematical
transformation that converts a discrete-time signal from the time domain
into the frequency domain. It reveals the frequency components present in
the signal and their respective magnitudes and phases.
Y = fft(y);
L = length(y);
f = Fs*(0:(L/2))/L;
P = abs(Y/L);
P = P(1:L/2+1);
plot(f, P)
title('Single-Sided Amplitude Spectrum of Music Signal')
xlabel('Frequency (Hz)')
ylabel('Amplitude') )
Classical Signal Processing 15
This code snippet demonstrates how to load a music signal, compute its
Fourier transform, and plot the single-sided amplitude spectrum. By
analyzing the resulting spectrum, you can identify the dominant frequencies
present in the music signal.
Solution:
Step 1: Load the noisy audio signal and the background noise in
MATLAB.
MATLAB example:
Step 2: Compute the Fourier transforms of the noisy audio signal and
the background noise.
MATLAB example:
Y = fft(y);
N = fft(noise);
Step 3: Compute the power spectral densities (PSDs) of the noisy audio
signal and the background noise.
MATLAB example:
PSD_y = abs(Y).^2;
PSD_n = abs(N).^2;
Step 4: Estimate the noise power spectrum by averaging the PSD of the
background noise.
MATLAB example:
Step 5: Subtract the estimated noise power spectrum from the PSD of
the noisy audio signal.
MATLAB example:
Step 6: Reconstruct the clean audio signal using the inverse Fourier
transform.
MATLAB example:
The theory behind Wiener filtering involves the statistical properties of the
desired signal and the noise. It assumes that both the desired signal and the
noise are stochastic processes and have certain statistical characteristics.
The Wiener filter aims to estimate the clean signal by considering the
statistical properties of both the desired signal and the noise. It computes a
filter transfer function that minimizes the mean square error between the
estimated clean signal and the desired signal. The filter transfer function is
computed based on the PSDs of the desired signal and the noise. The Wiener
filter assumes that the clean and noise signals are statistically uncorrelated.
Step 1: Load the noisy audio signal and the background noise in
MATLAB.
MATLAB example:
Step 2: Compute the Fourier transforms of the noisy audio signal and
the background noise.
MATLAB example:
Y = fft(y);
N = fft(noise);
Step 3: Compute the power spectral densities (PSDs) of the noisy audio
signal and the background noise.
MATLAB example:
PSD_y = abs(Y).^2;
PSD_n = abs(N).^2;
Step 4: Estimate the power spectral density of the clean audio signal
using the Wiener filter.
MATLAB example:
Step 5: Reconstruct the clean audio signal using the inverse Fourier
transform.
MATLAB example:
In the time domain approach, the noisy audio signal is directly processed in
the time waveform. Techniques such as temporal filtering, adaptive
filtering, and statistical modeling can be employed to estimate and suppress
the unwanted noise components in the signal. This approach operates on the
amplitude and temporal characteristics of the signal, making it suitable for
certain scenarios where time-domain processing is effective and simpler.
Both time and frequency domain noise reduction techniques can have
simpler implementations depending on the specific requirements and
constraints of the application. Here are some considerations for simpler
implementations in each domain:
20 Chapter II
Sampling process
= )ݐ(ݏσஶ
ୀିஶ ߜ( ݐെ ݊ܶ). (4)
With the sifting property2 of the unit impulse ߜ()ݐ, multiplying )ݐ(ݒby
)ݐ(ݏgives us the signal ݒ௦ ( )ݐas
2 The sifting property of the unit impulse ߜ( )ݐstates that when the impulse function
ߜ( )ݐis integrated with another function ݂()ݐ, it “sifts out” the value of ߜ( )ݐat t = 0.
Classical Signal Processing 23
ଵ
ୀିஶ ߜ(݂ െ ݂݇௦ ) and כis the convolution integral.
where ܵ(݂) = σஶ
்
Sampling is not without its challenges, such as aliasing, where the signal
gets distorted due to inadequate sampling rates. To prevent this, anti-
aliasing filters are crucial as they protect against unwanted frequencies,
ensuring the accuracy of the captured samples. By navigating the
complexities of sampling and embracing quantization, we can transform
continuous analog signals into digital form, like sculpting, shaping them
into discrete values for manipulation in the digital realm.
Quantization process
In other words, the integral of ߜ( )ݐtimes ݂( )ݐis equal to ݂(0). In general, it can be
ஶ
mathematically expressed as ିஶ ݂( ݐ(ߜ)ݐെ ݐ ) = ݂(ݐ ).
24 Chapter II
= ோ ( ݑെ ݍ )ଶ ݂| ( = ݑ݀)݉|ݑ ܧሾ(ܷ െ ݍ )ଶ |ܸ = ݉ሿ. (9)
Classical Signal Processing 25
It is known that the value of a that minimizes ܧሾ(ܺ െ ܽ)ଶ ሿ is the mean of
ܺ, i.e., ܧሾܺሿ = arg minୟܧ ୖאሾ(ܺ െ ܽ)ଶ ሿ. Therefore, the MSE is minimized
when we set ݍ equal to the conditional mean3 of ܷ given ܸ = ݉, i.e.,
ݍ = ܴ א ܷ|ܷ[ܧ = ]݉ = ܸ|ܷ[ܧ ].
οయ οమ
= σெ
ୀଵ ቀଵଶቁ = ଵଶ, (12)
ο
3 To see why, we can write ܺ([ܧെ ܽ)ଶ ] = ܺ[ܧଶ ] െ 2ܽ ]ܺ[ܧ+ ܽଶ . Differentiating
the expression with respect to ܽ and setting the result to zero, we can solve for the
optimal value of ܽ. And the result is equal to the mean ]ܺ[ܧ.
26 Chapter II
ο/ଶ
where we use the fact that ோ ( ݑെ ݍ )ଶ ݀ି = ݑο/ଶ ݓଶ ݀ ݓfor each length-
ο quantization region with the quantization point in the middle. Therefore,
the approximate MSE does not depend on the form of ݂ ( )ݑfor a high-rate
uniform quantizer.
Adaptive quantization, step size it adapts. Fine details preserved, where the
signal maps.
Capture and manipulate, with care and precision. In the realm of signals, the
ultimate mission.
Key takeaways from the sampling and quantization section are given as
follows:
Layman’s guide:
Imagine you have a signal, which could be anything from a sound wave to
an image. Sampling is the technique of capturing snapshots of that signal at
specific points in time. It is like taking freeze-frame pictures that allow us
to work with the signal in a digital form.
MATLAB example:
subplot(2,1,2);
hold on;
plot(0:1/sampling_freq_1:1, reconstructed_signal_1, 'ro-', 'LineWidth',
1.5);
plot(0:1/sampling_freq_2:1, reconstructed_signal_2, 'gs--', 'LineWidth',
1.5);
legend('Sampling Freq = 40', 'Sampling Freq = 100');
title('Reconstructed Signals');
xlabel('Time');
ylabel('Amplitude');
Figure 2-5 illustrates the results, showcasing both the original analog signal
and the corresponding reconstructed signals.
Classical Signal Processing 31
MATLAB example:
subplot(3,1,2);
stem(t, uniform_quantized_signal, 'r:', 'LineWidth', 0.3);
title('Uniform Quantization');
xlabel('Time');
ylabel('Amplitude');
subplot(3,1,3);
stem(t, log_quantized_signal, 'g--', 'LineWidth', 0.3);
title('Logarithmic Quantization');
xlabel('Time');
ylabel('Amplitude');
Figure 2-6 visually presents the outcome, depicting the trade-offs observed
when comparing uniform and non-uniform quantization techniques.
Classical Signal Processing 33
Figure 2-6: MATLAB example of the trade-offs between uniform and non-uniform
quantization techniques.
Signal filtering
Convolution
As for the equations explaining convolution, one of the key equations is the
mathematical expression of convolution:
ஶ
ି = )ݐ(݄ כ )ݐ(ݔ = )ݐ(ݕஶ ݐ(݄ )߬(ݔെ ߬)݀߬, (17)
where )ݐ(ݔrepresents the input signal, ݄( )ݐrepresents the impulse response
function or filter, and )ݐ(ݕrepresents the output signal resulting from the
convolution of )ݐ(ݔand ݄()ݐ. It is computed according to the following
steps:
where ܺ(݂) and )݂(ܪrepresent the Fourier transforms of the input signal
and the impulse response function/filter, respectively, while ܻ(݂) represents
the Fourier transform of the output signal. These equations form the basis
for understanding and utilizing convolution in signal processing and are
essential tools in analyzing and designing signal processing systems.
These are just a few examples of the diverse range of applications where
convolution is utilized. The flexibility and effectiveness of convolution
make it a powerful tool in various fields that deal with data analysis, pattern
recognition, and information extraction.
Let us consider two 2-D signals: the input signal, often referred to as the
image, denoted by ݔ(ܫ, )ݕand a 2-D filter, denoted by ݑ(ܭ, )ݒwhere ݔ, ݕ,
ݑ, and ݒrepresent the spatial coordinates. The 2-D convolution operation is
defined as
To compute the output value at each coordinate (ݔ, )ݕ, the filter ݑ(ܭ, )ݒis
placed on top of the input signal ݔ(ܫെ ݑ, ݕെ )ݒ, and element-wise
multiplication is performed. The results are then summed over all spatial
locations defined by the filter. This process is repeated for all coordinates
(ݔ, )ݕof the output signal ܫᇱ (ݔ, )ݕ.
determines the specific operation and the information extracted from the
image.
Additionally, similar to 1-D convolution, 2-D convolution also has its own
convolution theorem. The 2-D convolution theorem states that the Fourier
transform of the 2-D convolution of two signals is equal to the pointwise
multiplication of their individual Fourier transforms.
Key takeaways from the signal filtering and convolution are given as
follows:
Layman’s guide:
Signal filtering is like sorting through a signal to extract specific parts and
manipulate them. Imagine you have a bowl of soup with different
ingredients, and you want to separate out the vegetables from the broth. That
is similar to what signal filtering does with signals.
There are different types of filters that perform different tasks. Think of
them as sieves with different-sized holes. A low-pass filter allows low-
frequency components of a signal to pass through, while blocking higher
frequencies. A high-pass filter does the opposite, letting high frequencies
through and blocking low frequencies. Band-pass filters only allow a
specific range of frequencies to pass, and band-stop filters block a specific
range of frequencies.
When designing a filter, there are important considerations. The filter order
determines how complex the filter is and how well it can do its job. Cutoff
frequencies define the range of frequencies you want to allow or block.
Attenuation characteristics determine how much the filter reduces certain
frequencies.
Suppose you have recorded an audio signal that contains both the desired
speech and background noise. You want to enhance the speech signal by
removing the noise using a suitable filtering technique. Design a low-pass
filter to achieve this objective.
Solution:
MATLAB example:
% Play the original audio signal and the filtered audio signal to compare
sound(audioSignal, Fs); % Play the original audio signal
pause; % Pause before playing the filtered audio signal
sound(filteredSignal, Fs); % Play the filtered audio signal
Problem 2:
You have an image that has been corrupted by random noise, which is
affecting the image quality. Design a filter to remove the noise and enhance
the image details.
Solution:
Remember, the specific filter design and implementation steps may vary
depending on the nature of the noise and the image. It is important to analyze
the problem carefully and choose the appropriate filtering technique
accordingly.
MATLAB example:
Please note that the provided MATLAB codes are simplified examples and
may need adjustments based on your specific requirements, input data, and
desired outcomes. Make sure to adapt the code accordingly and incorporate
any additional preprocessing or post-processing steps as needed.
Problem 3:
(ݔ݁ = )ݐ(ݔെ)ݐ(ݑ)ݐ.
where )ݐ(ݑis the unit step function, and the following continuous impulse
response function: ݄((ݔ݁ = )ݐ2)ݐ(ݑ)ݐ.
Perform the continuous convolution of the input signal with the impulse
response function using MATLAB.
46 Chapter II
Solution:
For ݐ 0, both )߬(ݔand ݄( ݐെ ߬) are zero. Therefore, the result of the
integral becomes zero. For > ݐ0, both )߬(ݔand ݄( ݐെ ߬) are non-zero, we
continue evaluating the integral as
௧
= )ݐ(ݕන exp(2 ݐെ ߬)݀߬,
We can use the conv function in MATLAB along with the symbolic math
toolbox for continuous convolution. Here is the MATLAB code:
Figure 2-7 presents the visual representation of the result, showcasing the
output obtained from the convolution between the input signal and the
impulse response function.
48 Chapter II
By analyzing signals in both the time and frequency domains and employing
representations like the time-frequency distribution and spectrogram, we
can gain valuable insights into their time-varying characteristics and
frequency components. These tools are widely used in various fields,
including audio processing, image processing, and communications.
Time domain reveals a signal's behavior over time. While frequency domain
identifies frequencies, prime.
By studying both domains, we grasp signals' full view. Gaining insights into
their characteristics, old and new.
These tools find use in audio, image, and communication. Unraveling the
complexities of signals, our dedicated mission.
Key takeaways from the time and frequency representations are given as
follows
Classical Signal Processing 51
Layman’s guide:
Time and frequency representations help us understand how signals behave
and what frequencies are present in them. Imagine you have a song playing
on your music player. The time representation shows how the song changes
over time—when the beats drop, when the chorus comes in, and how the
volume changes. The frequency representation tells you what notes or
pitches are present in the song—whether it has high or low tones, and if
there are any specific musical instruments playing.
Solution:
1. Load the audio file into MATLAB using the audioread function.
2. Apply a high-pass filter to remove low-frequency noise that might
be present in the recording. Use the designfilt function to design
the filter with a suitable cutoff frequency.
3. Plot the time-domain representation of the original audio signal
using the plot function to visualize how the music changes over
time.
4. Compute the Fourier Transform of the audio signal using the fft
function to analyze the frequency content. Plot the magnitude
Classical Signal Processing 53
MATLAB example:
title('Frequency-Domain Representation');
% Create a spectrogram
windowLength = 1024; % Set the window length for the spectrogram
overlap = windowLength/2; % Set the overlap ratio
spectrogram(audio, windowLength, overlap, [], Fs, 'yaxis');
title('Spectrogram');
Problem 2:
You are working on a speech recognition system and need to extract the
relevant features from a spoken sentence to classify and recognize the words
accurately. You want to use time and frequency representations to analyze
the speech signal and extract discriminative features.
Solution:
Note: The provided solutions outline the general steps involved in solving
the problems. The specific MATLAB code implementation may vary
depending on the requirements, signal characteristics, and chosen signal
processing techniques.
MATLAB example:
% Preprocessing
speech = speech - mean(speech); % Remove DC offset
window = hamming(0.03*Fs, 'periodic'); % Hamming window
overlap = round(0.01*Fs); % 10 ms overlap
While this book may not delve into the fundamentals of probability theory,
random variables, and random processes in detail, it is highly recommended
for readers to refresh their understanding of these concepts before
proceeding further. Having a solid grasp of these fundamental concepts will
provide a strong foundation for comprehending the advanced topics and
techniques discussed throughout the book. It will also enable readers to
make connections and better appreciate the applications and significance of
statistical signal processing. Therefore, take a moment to recap your
knowledge and ensure you have a good understanding of probability theory,
random variables, and random processes before diving into the subsequent
chapters.
Estimators
To estimate the population mean (ߤ) using the sample mean (ܺത), we can
use the following formula:
ଵ
ߤƸ = ܺത= σୀଵ ܺ , (24)
In this case, the estimator (ܺത) is simply the sample mean itself. It provides
an estimate of the unknown population mean (ߤ) based on the observed
data.
Estimators are designed to provide the best possible estimate of the true
parameter values based on the available data. The concept of “optimal”
estimation typically involves minimizing the bias (difference between the
expected value of the estimator and the true parameter value) and/or the
variance (a measure of the estimator's variability). The sample mean serves
as an estimator for the population mean (ߤ), providing an estimate of the
average value of the variable in the population based on the observed data
in the sample. The larger the sample size, the more reliable the sample mean
becomes as an estimator for the population mean.
Point estimation
value, often denoted as a point estimator, that represents the best guess for
the true value of the parameter.
The point estimate (ߤƸ ) is equal to the sample mean (ܺത), meaning that the
sample mean serves as both an estimator and a point estimate for the
population mean. The terms “estimator” and “point estimate” are often used
interchangeably in practice. They refer to the same concept, which is using
a statistic to estimate an unknown population parameter.
It is important to note that a point estimate is a single value, and it may not
exactly match the true population parameter. There is a degree of
uncertainty associated with point estimation. The accuracy of the point
estimate depends on various factors, such as the sample size, sampling
method, and variability within the population.
Interval estimation
range of values that is likely to contain the true parameter value with a
specified level of confidence.
In this formula, the “Estimate” represents the point estimate obtained from
the sample, and the “Margin of Error” represents a measure of uncertainty
that accounts for the variability of the estimator.
The margin of error is typically based on the standard error of the estimator,
which quantifies the average deviation between the estimator and the true
parameter value across different samples. The standard error is influenced
by factors such as the sample size, the variability of the data, and the
distributional assumptions.
For example, let us consider estimating the population mean (ߤ) using the
sample mean (ܺത) with a 95% confidence interval. The formula for
௦
constructing the confidence interval is ܺത ± ݖቀ ቁ.
ξ
In this formula, ܺത represents the sample mean, ݖis the critical value from
the standard normal distribution corresponding to the desired confidence
level (e.g., 1.96 for a 95% confidence level), ݏrepresents the sample
standard deviation, and ݊ is the sample size.
the estimator (usually represented by the standard error), and the chosen
confidence level. They provide a measure of uncertainty associated with the
estimation process. The width of the confidence interval depends on the
confidence level and the variability of the data.
Signal detection theory and hypothesis testing are two important concepts
in statistics and decision-making. These concepts involve making decisions
based on observed data and statistical measures. Additionally, Bayesian
statistics provides a framework for decision-making that incorporates prior
beliefs and observed data.
Both the MAP and ML decision rules are used in Bayesian statistics to make
decisions based on observed data. They involve estimating parameters
(ߠ) and selecting the option that maximizes the posterior probability
(ܲ(ߠ|ܺ)) for MAP or the likelihood function (ܲ(ܺ|ߠ)) for ML.
where ݂(ή) represents the classification model. The classification model can
take various forms depending on the specific algorithm used. For instance,
decision trees partition the feature space based on a series of if-else
64 Chapter II
Here, ݓrepresents the weight vector, ݔ is the feature vector of the ݅ െ ݄ݐ
training sample, ܾ is the bias term, and ݕ is the class label of the ݅ െ ݄ݐ
sample.
Once the features are extracted, they are represented as feature vectors or
matrices, enabling mathematical operations and analysis. Classification
algorithms, such as decision trees, SVMs, or neural networks, are then
employed to learn the underlying patterns and relationships between the
features and their corresponding class labels. These algorithms use
mathematical optimization methods, such as gradient descent or maximum
likelihood estimation, to find the best parameters that minimize the
classification error or maximize the model's performance metrics.
Important techniques for analysis, you see. Using statistical methods, it aims
to be.
Key takeaways from the statistical signal processing are given as follows:
Layman's Guide:
The chapter on statistical signal processing introduces important concepts
and techniques for analyzing and processing signals using statistical
methods. It emphasizes the role of probability theory, random variables, and
random processes in understanding uncertainty in signal processing.
In this problem, we are dealing with a received signal that can either be a
“0” or a “1” with equal probabilities. However, the signal is corrupted by
additive white Gaussian noise (AWGN), which introduces uncertainty into
the observed signal. Our task is to design a detector that can determine
whether the received signal is a “0” or a “1” based on the observed noisy
signal.
Solution:
MATLAB example:
% Parameters
threshold = 0; % Threshold value
% Detection
if receivedSignal > threshold
detectedSignal = 1; % Signal above threshold is detected as "1"
else
detectedSignal = 0; % Signal below threshold is detected as "0"
end
% Display results
disp(['True Signal: ', num2str(trueSignal)]);
disp(['Received Signal: ', num2str(receivedSignal)]);
disp(['Detected Signal: ', num2str(detectedSignal)]);
The obtained results reveal the following findings:
True Signal: 1
Received Signal: 2.8339
Detected Signal: 1
Problem 2:
where
Our task is to estimate the values of ܣ, ݂, and ߮ based on the observed
signals.
Solution:
Now, let us derive the maximum likelihood estimators for ܣ, ݂, and ߮ using
a mathematical approach and then implement the solution in MATLAB:
Mathematical Solution:
ଵ
ܣ =ට σே ଶ
ୀଵ ݔ
ே
MATLAB example:
% Estimation
estimatedA = sqrt(mean(observedSignal.^2)); % Estimating the amplitude
fftSignal = abs(fft(observedSignal)); % Compute FFT
[~, index] = max(fftSignal(1:length(fftSignal)/2)); % Find peak in PSD
estimatedF = index / (length(t) * (t(2) - t(1))); % Estimating the frequency
correlation = sum(observedSignal .* sin(2*pi*estimatedF*t + phi)); %
Compute correlation
estimatedPhi = angle(correlation); % Estimating the phase
% Display results
disp(['True Amplitude: ', num2str(A)]);
disp(['Estimated Amplitude: ', num2str(estimatedA)]);
disp(['True Frequency: ', num2str(f)]);
disp(['Estimated Frequency: ', num2str(estimatedF)]);
disp(['True Phase: ', num2str(phi)]);
disp(['Estimated Phase: ', num2str(estimatedPhi)]);
% Plot signals
figure;
subplot(2, 1, 1);
plot(t, trueSignal, 'b', 'LineWidth', 2);
hold on;
plot(t, observedSignal, 'r', 'LineWidth', 1);
hold off;
xlabel('Time');
ylabel('Amplitude');
legend('True Signal', 'Observed Signal');
72 Chapter II
subplot(2, 1, 2);
plot(t, observedSignal, 'r', 'LineWidth', 1);
hold on;
plot(t, estimatedA * sin(2*pi*estimatedF*t + estimatedPhi), 'g--',
'LineWidth', 2);
hold off;
xlabel('Time');
ylabel('Amplitude');
legend('Observed Signal', 'Estimated Signal');
title('Observed and Estimated Signals');
In this MATLAB code, we first generate the true sinusoidal signal with a
given amplitude, frequency, and phase. We add AWGN to the true signal to
create the observed signal. Then, we estimate the parameters using the
derived formulas: amplitude ()ܣ, frequency, (݂), and phase (߮). Finally, we
display the true and estimated values of the parameters and plot the true
signal, observed signal, and estimated signal for visualization.
Note: The above code assumes that the noise follows a standard Gaussian
distribution with zero mean and unit variance. Adjustments may be needed
for specific noise characteristics or distributions.Top of Form
The obtained results reveal the following findings and the plot in Figure 2-
7.
Figure 2-8 illustrates the result, displaying the true signal, observed signal,
and the estimated signal obtained through parameter estimation.
Classical Signal Processing 73
Solution:
x Let Y_train be a vector of size 100x1 containing the labels for the
training signals (1: Class A, 2: Class B, 3: Class C).
x Let X_test be a matrix of size 20x50 containing the feature vectors
of the test signals.
x Let Y_test be a vector of size 20x1 containing the true labels for
the test signals.
x Use the trained model to predict the labels of the test signals.
x Let Y_pred be the predicted labels for the test signals.
MATLAB example:
% Compute precision
precision = zeros(numClasses, 1);
for i = 1:numClasses
precision(i) = confusionMat(i, i) / sum(confusionMat(:, i));
end
subplot(2, 1, 2);
plot(unlabeledSignals(groundTruthLabels == 1, :)', 'b');
hold on;
plot(unlabeledSignals(groundTruthLabels == 2, :)', 'r');
plot(unlabeledSignals(groundTruthLabels == 3, :)', 'g');
hold off;
title('Ground Truth');
xlabel('Time');
Classical Signal Processing 77
ylabel('Signal Value');
legend('Ground Truth Class 1', 'Ground Truth Class 2', 'Ground Truth
Class 3');
figure;
bar(isCorrect);
title('Element-wise Comparison');
xlabel('Label (1, 2, and 3)');
ylabel('Comparison Result');
xticks(1:numel(groundTruthLabels));
xticklabels(groundTruthLabels);
The obtained results reveal the following findings and the relevant plots
(signals versus time, confusion matrix, element-wise comparison (correctness)
of unlabeled signals) in Figures 2-8-2-10.
Accuracy: 1
Confusion Matrix:
20 0 0
0 20 0
0 0 20
Precision:
1
1
1
78 Chapter II
The outcomes are visualized in Figures 2-9 and 2-10, depicting the
prediction of unlabeled signals alongside the ground truth and the
corresponding confusion matrix, respectively. Figure 2-11 showcases the
element-wise comparison, highlighting the correctness of the unlabeled
signals.
Figure 2-9: Signals versus time of the classification and Pattern recognition.
Classical Signal Processing 79
Note that the correctness curve indicating whether each prediction is correct
or incorrect is based on the unlabeled signals and the corresponding ground
truth labels.
CHAPTER III
that go beyond the traditional methods used in classical signal processing. It involves
the utilization of innovative approaches to analyze and process signals, particularly
in challenging scenarios where traditional techniques may be limited or insufficient.
It consists of several techniques such as wavelet transforms and time-frequency
analysis, compressed sensing and sparse signal processing, machine learning and
deep learning for signals, and signal processing for non-Euclidean data.
Non-Classical Signal Processing 83
features and changes in the signal more effectively, making them well-
suited for non-stationary signals.
where )ݐ(ݔis the input signal, ȥ(t) is the mother wavelet function, a
represents the scale parameter that controls the width of the wavelet, and b
represents the translation parameter that shifts the wavelet along the time
axis. By applying the CWT, we obtain a time-scale representation of the
signal, revealing how its frequency content changes over different time
intervals.
where )߬(ݔrepresents the signal, ݃( )ݐis a Gaussian window function, and
݂ is the frequency variable. The Gabor transform provides a detailed
examination of the signal's behavior in the time-frequency domain.
Using the CWT, we can obtain a time-scale representation of the signal. For
instance, if we choose the Mexican hat wavelet as the mother wavelet, we
can identify the time intervals where the sustained tones and transients
occur. This information helps us understand the temporal variations in the
frequency content of the musical piece.
By utilizing wavelet transforms, the STFT, and the Gabor transform, we can
effectively analyze and process the non-stationary audio signal. These
techniques enable us to capture the dynamic changes in the signal's
Non-Classical Signal Processing 85
STFT reveals how frequencies evolve in time. Gabor combines Fourier and
windows, a harmonic chime.
Transient features and changes, they capture with ease. Wavelet transforms
excel in non-stationary seas.
Layman's Guide:
Imagine you have a signal, like a piece of music or an image. Wavelet
transforms and time-frequency analysis help us understand and analyze this
signal by looking at both its time and frequency characteristics.
Non-Classical Signal Processing 87
The short-time Fourier transform divides the signal into small overlapping
segments and examines the frequency content of each segment. It helps us
understand how the signal's frequency components vary over time intervals.
It is like taking snapshots of the signal's frequency content as it progresses.
Thus, whether you are music lover, an image enthusiast, or just curious
about signals, wavelet transforms and time-frequency analysis open up a
whole new world of understanding. They help us appreciate the richness
and complexity of signals and enable us to extract meaningful information
from them.
88 Chapter III
Suppose you have a signal corrupted by noise, and you want to remove the
noise to recover the original signal. One approach is to use wavelet
thresholding, which exploits the sparsity of the signal in the wavelet
domain.
Solution:
In this problem, we assume that the noise is additive and follows a Gaussian
distribution. We estimate the noise standard deviation from the noisy signal
itself. Once we have the wavelet coefficients, we apply a thresholding
operation to suppress the coefficients corresponding to noise.
Finally, we reconstruct the denoised signal using the inverse DWT, which
combines the modified wavelet coefficients to obtain the denoised signal.
MATLAB example:
Figure 3-1 illustrates the process of denoising a noisy signal through the
utilization of wavelet thresholding.
90 Chapter III
Suppose you have a speech signal and you want to analyze its time-
frequency characteristics to identify specific phonemes or speech patterns.
Solution:
In this problem, we divide the speech signal into short overlapping segments
and compute the Fourier transform for each segment. By using a sliding
window, we obtain a series of frequency spectra corresponding to different
time intervals. This representation is commonly referred to as a spectrogram.
MATLAB example:
costs, and enable more accurate and targeted analysis in various signal
processing applications.
where ܠis the sparse signal, ܡis the measurements, is the measurement
matrix, and ߝ is the noise level.
where and are the i-th and ݆-th columns of the measurement matrix
.
Efficient and accurate, they process with flair. Extracting information, from
sparse signals they care.
Key takeaways from the Compressed sensing and sparse signal processing
are given as follows:
Layman's Guide:
In non-classical signal processing, there are two important techniques called
compressed sensing and sparse signal processing. These techniques offer
new ways to handle signals that have limited measurements or sparse
representations.
Sparse signal processing focuses on processing signals that have this sparse
property. It uses this sparsity to develop efficient algorithms for tasks like
analyzing, denoising, and compressing signals. By exploiting sparsity, we
98 Chapter III
Solution:
To solve this problem, we can use the basis pursuit algorithm. Here is a step-
by-step solution:
MATLAB example:
subplot(2, 1, 2);
stem(x_reconstructed, 'r', 'filled');
title('Reconstructed Sparse Signal');
xlabel('Index');
ylabel('Amplitude');
In this code, we use the lasso function from MATLAB's Statistics and
Machine Learning Toolbox to solve the basis pursuit problem. The lasso
function performs sparse regression using the L1 regularization technique.
We specify the regularization parameter lambda to control the sparsity level
of the solution. The code then plots the original sparse signal and the
reconstructed signal for comparison.
Please note that the availability of the lasso function depends on having the
Statistics and Machine Learning Toolbox installed. If you encounter any
errors related to the lasso function, please ensure that you have the required
toolbox installed.
Let us delve deeper into the mathematics behind machine learning models
and provide examples of MATLAB code. We start from the simplest one.
ܠ ் ܟ = ݕ+ ܾ, (35)
102 Chapter III
where ݕis the predicted value, ܟis the weight vector, ܠis the
input vector, and ܾ is the bias term.
In this example, we generate synthetic data for the input vector x, the true
output y_true (without noise), and the observed output y (with added
Gaussian noise). We then perform linear regression by creating a design
matrix X that includes the input vector x and a column of ones (to account
for the bias term). The weight vector w is calculated using the pseudo-
inverse of X multiplied by the observed output y. Finally, we use the weight
vector to compute the predicted output y_pred.
The code then plots the observed data as scatter points, the true line (without
noise), and the predicted line based on the linear regression model. The x-
axis represents the input vector x, and the y-axis represents the output y.
The legend indicates the different elements in the plot.
You can run this code in MATLAB to generate the signal and visualize the
results of the linear regression.
104 Chapter III
where is the predicted probability, ܟis the weight vector, ܠis
the input vector, and b is the bias term.
In the code, replace 'path_to_folder' with the actual path to the folder that
contains the sigmoid function file. This ensures that the sigmoid function is
properly loaded for use in the code.
Please make sure that you have the sigmoid function defined in a separate
MATLAB file (e.g., sigmoid.m) and placed in the specified folder. The
sigmoid function should have the following code:
Non-Classical Signal Processing 105
function y = sigmoid(x)
y = 1 ./ (1 + exp(-x));
end
In the code example, we first generate some sample data (X) with
corresponding binary labels (Y). We then use the fitctree function to train
a decision tree classifier on the data. The fitctree function automatically
splits the data based on the input features and creates the decision tree.
We can visualize the decision tree using the view function with the 'Mode',
'Graph' option, which displays the tree as a directed graph. The resulting
graph shows the decision rules and splits at each internal node.
To make predictions for new data (newX), we use the predict function with
the trained decision tree. The predict function returns the predicted labels
based on the learned decision rules.
Finally, the predicted labels are displayed using the disp function.
Please note that the example provided uses a simple dataset for
demonstration purposes. In practice, decision trees can handle datasets with
multiple features and larger sample sizes. The MATLAB functions fitctree
and predict provide various options and parameters to customize the
decision tree's behavior and performance.
Note that the specific algorithms used to build decision trees and
aggregate predictions in Random Forests can vary. The above
formulation represents the general idea behind Random Forests.
In this code, after training the Random Forest classifier and computing the
decision boundaries, the contourf function is used to plot the decision
boundaries as filled contour regions. The scatter function is used to plot the
actual data points, with different colors representing the two classes. The
resulting plot shows the decision boundaries learned by the Random Forest
classifier and the distribution of the data points in the feature space.
% Plot Results
figure;
scatter(x, y, 10, classLabels, 'filled');
hold on;
scatter(xTest, yTest, 10, predictedLabels, 'x');
hold off;
title('Naive Bayes Classification');
xlabel('x');
ylabel('y');
legend('Training Data', 'Test Data');
Figure 3-7 displays the results obtained from training and testing data in an
example of a Naive Bayes classifier.
112 Chapter III
Given an unseen data point ݔ, the algorithm follows these steps:
݀ =
ඥ((ݔଵ െ ݔଵ )ଶ + (ݔଶ െ ݔଶ )ଶ +. . . +(ݔெ െ ݔெ )ଶ ) , (41)
where (ݔଵ , ݔଶ , . . . , ݔெ ) are the feature values of the ݅-th
labeled data point.
% Set legend
legend('Class 1', 'Class 2', 'Class 3', 'New Data Point');
a)
b)
Figure 3-8: An example of a K-nearest neighbor (KNN) classifier: a) test set versus
accuracy and b) scatter plot of feature 1 versus feature 2.
116 Chapter III
where || ||ܟrepresents the ܮ2 norm of the weight vector, ܥis the
regularization parameter that balances the trade-off between
achieving a larger margin and minimizing the classification errors,
ݕ represents the class label of the training sample ܠ , and the
summation is performed over all training samples.
xlabel('Feature 1');
ylabel('Feature 2');
legend('Class 1', 'Class 2', 'Class 3');
% Perform cross-validation
cvModel = crossval(svmModel);
predictedY_all = kfoldPredict(cvModel);
% Compare the predicted label with the expected label for the
unlabeled signal
expectedLabel_unlabeled = 3; % Replace with the expected label
for the unlabeled signal
isCorrect_unlabeled = (predictedClass_unlabeled ==
expectedLabel_unlabeled);
a)
b)
Figure 3-9: An example of a support vector machine (SVM): a) scatter plot of feature
1 versus feature 2 and b) element-wise comparison of unlabeled signal.
120 Chapter III
The goal of SVR is to find a function that best approximates the mapping
between input variables (features) and the corresponding continuous target
variable. It aims to minimize the prediction error while also controlling the
complexity of the model. SVR is particularly useful when dealing with
nonlinear relationships and can handle both linear and nonlinear regression
problems.
The SVR algorithm aims to find the optimal regression function by solving
a convex optimization problem. This involves minimizing the loss function
while satisfying the margin constraints and incorporating regularization.
Various optimization techniques can be used, such as quadratic programming
or gradient descent.
subplot(2, 1, 2);
plot(t, y_noisy, 'LineWidth', 1);
122 Chapter III
xlabel('Time');
ylabel('Amplitude');
title('Noisy Signal');
a)
124 Chapter III
b)
Figure 3-10: Example of support vector regression (SVR): a) combined signal and
noisy signal and b) SVR prediction.
In this example, we generate three synthetic signals (sine waves and a cosine
wave) and combine them to create a target signal. We then add some
Gaussian noise to the combined signal. The input features (X) are the time
vector, and the target variable (y_target) is the combined signal.
We split the data into training and testing sets using a hold-out method.
Next, we train the GBM model using the fitensemble function with the
“LSBoost” method and 100 weak learners (decision trees). We then make
predictions on the test data using the trained model.
You can modify the example by adjusting the signal frequencies, adding
more signals, changing the noise level, or exploring different boosting
methods and parameters in the GBM model.
The input layer is responsible for receiving the input data, such
as images, text, or numerical features. Each node in the input
layer represents a feature or input variable.
Non-Classical Signal Processing 129
The hidden layers, as the name suggests, are the layers that
come between the input and output layers. They are
responsible for performing computations and extracting
relevant features from the input data. Each node in the hidden
layers takes the weighted sum of its inputs, which are the
outputs from the previous layer. The weights represent the
strength or importance of the connections between the nodes.
The weighted sum is then passed through an activation
function, which introduces non-linearities into the network.
The activation function determines the output or activation
level of the node based on the weighted sum. Common
activation functions include sigmoid, tanh, ReLU (Rectified
Linear Unit), and softmax.
maxPooling2dLayer(2)
fullyConnectedLayer(10)
softmaxLayer
classificationLayer('Classes', categorical(1:10)) % Specify
the classes here
];
subplot(1, 2, 2);
bar(output);
title('Output Probabilities');
xlabel('Class');
ylabel('Probability');
4. CNN Variants: Let us dive into more detail about some CNN
variants. there are also different types of CNNs based on the
dimensionality of the input data. Two commonly used variants
are 2-D CNNs and 3-D CNNs.
Apart from these variants, there are several other notable CNN
architectures, including:
for i = 1:numSamples
X(:, i) = x(i:i+sequenceLength-1)';
Y(i) = x(i+sequenceLength);
end
Figure 3-16: the signal prediction results obtained from an example of a recurrent
neural network (RNN).
% Parameters
numSamples = 1000; % Number of time points in the time
series
t = 1:numSamples; % Time index
subplot(2, 1, 2);
plot(t, y2);
title('Simulated Time Series: Sinusoidal with Noise');
xlabel('Time');
ylabel('Value');
In the given code, two examples of simulated time series data are provided.
The corresponding figures are displayed in Figure 3-17.
Figure 3-17: Two examples of simulated time series data, i.e., random
walk and sinusoidal with noise.
144 Chapter III
% Parameters
numSamples = 1000; % Number of time points in the time
series
t = 1:numSamples; % Time index
% LSTM model
% Prepare training data for LSTM
inputSize = 10;
outputSize = 1;
XTrain1 = [];
YTrain1 = [];
for i = 1:length(y1)-inputSize-outputSize
XTrain1 = [XTrain1; y1(i:i+inputSize-1)];
YTrain1 = [YTrain1;
y1(i+inputSize:i+inputSize+outputSize-1)];
end
XTrain2 = [];
YTrain2 = [];
for i = 1:length(y2)-inputSize-outputSize
XTrain2 = [XTrain2; y2(i:i+inputSize-1)];
YTrain2 = [YTrain2;
y2(i+inputSize:i+inputSize+outputSize-1)];
end
Non-Classical Signal Processing 145
XTest2 = y2(end-inputSize+1:end);
YPred2 = zeros(1, numSamples);
YPred2(1:length(XTest2)) = XTest2;
for i = length(XTest2)+1:numSamples
XTest2 = YPred2(i-inputSize:i-1);
YPred2(i) = predict(net2, XTest2');
end
subplot(2, 1, 2);
hold on;
plot(t, y2, 'b', 'LineWidth', 1.5);
plot(t, YPred2, 'g', 'LineWidth', 1.5);
xlabel('Time');
ylabel('Value');
legend('Actual', 'LSTM Prediction');
title('LSTM: Sinusoidal with Noise');
grid on;
hold off;
Figure 3-18: An example of prediction using a long short-term memory (LSTM) for
the two time series data.
LSTM variants build upon this basic LSTM architecture to enhance its
capabilities and address specific requirements.
7. LSTM Variants:
Prepare the data, scale it right, select relevant features in sight. To unleash
the power of models and make your analysis take flight.
Support vector machines, the classifiers with finesse. Group signals into
categories, their characteristics assess. K-nearest neighbors, finding
similarity in signals' embrace. Classifying based on neighbors, their features
they embrace.
Key takeaways from the machine learning and deep learning for signals are
given as follows:
Layman's Guide:
Machine learning and deep learning models are powerful tools for analyzing
different types of data.
Data preparation is important before using any model to ensure the data is
scaled and relevant features are selected.
Deep neural networks (DNN) learn from data and understand complex
patterns and relationships in signals.
These models are used in various fields such as healthcare, finance, and
speech recognition to analyze signals and make predictions.
154 Chapter III
MATLAB example:
Please note that this is a simplified example, and you can customize it based
on your specific requirements and dataset.
clear all
%
% Train a convolutional neural network on some synthetic images
% of handwritten digits. Then run the trained network on a test
% set, and calculate the accuracy.
layers = [ ...
imageInputLayer([28 28 1])
convolution2dLayer(5,20)
reluLayer
maxPooling2dLayer(2,'Stride',2)
156 Chapter III
fullyConnectedLayer(10)
softmaxLayer
classificationLayer];
options = trainingOptions('sgdm', 'Plots', 'training-progress');
net = trainNetwork(XTrain, YTrain, layers, options);
% Compute F1-score
f1 = 2 * (precision .* recall) ./ (precision + recall);
accuracy =
0.9802
Accuracy: 98.02%
Precision: 98.02%
Recall: 98.03%
F1-Score: 98.02%
Non-Classical Signal Processing 157
Figure 3-21 illustrates the accuracy and the loss curves of a Convolutional
Neural Network (CNN) classifier for handwritten digits classification.
Figure 3-21: The accuracy and the loss curves of a Convolutional Neural Network
(CNN) classifier for handwritten digits classification.
Here is a list of techniques that can be used to expand the signal processing
toolbox for non-Euclidean data:
subplot(2, 1, 2);
stem(filtered_signal);
title('Filtered Signal');
xlabel('Node');
ylabel('Signal Value');
Note that you may need to install the MATLAB Graph and Digraph toolbox
(graph and digraph functions) to run this code.
Figure 3-24: The 5-node graph structure and the original, noisy, denoised, and
filtered signals of Example 2.
The colormap function sets the color map to ‘parula’, and the node_colors
variable assigns normalized signal values to each node. We then update the
NodeCData property of the plot object (p) to reflect the node colors.
Additionally, we adjust the marker size and remove the node labels for
better visualization. By coloring the nodes based on signal values, we
visually highlight the ability of non-Euclidean signal processing techniques
to extract meaningful information from complex network structures and
Non-Classical Signal Processing 165
Figure 3-25: An example of network analysis and the visualization of the signal
values on the nodes.
The modularity score of -2.9167 means that the community structure of the
network is not well-defined or does not exhibit strong modular patterns.
Modularity scores typically range from -1 to 1, where values close to 1
indicate a strong community structure and values close to -1 indicate a lack
of community structure.
Non-Classical Signal Processing 167
In this case, the negative modularity score suggests that the network's
partition into communities is not significantly different from a random
network. It indicates that the network's edges are not strongly clustered
within communities and do not exhibit clear modular patterns.
It's worth noting that the modularity score can be influenced by various
factors, such as the specific algorithm used for community detection, the
network topology, and the quality of the input data. In this example, the
modularity score suggests a lack of well-defined communities in the
network.
Please note that this simplified approach may not produce the same results
as more sophisticated community detection algorithms. However, it
provides a basic implementation for demonstration purposes.
The main script executes the community detection and plot the network with
community colors. The modularity_communities() function performs the
community detection using the modularity-based approach.
In domains like social sciences and more. It delves into network structures,
right at the core.
Clusters and modules, they come to light. Unveiling structures that were
once out of sight.
Centrality measures identify the most influential nodes. Those that control
the network's ebbs and flows.
Key takeaways from the Signal processing for non-Euclidean data are given
as follows:
Layman's Guide:
Signal processing for non-Euclidean data involves analyzing signals that
exist in networks or graphs instead of traditional one-dimensional or two-
dimensional spaces.
You have been given a set of temperature readings recorded at different time
intervals throughout a day. However, the readings contain some random
noise, making it difficult to identify any underlying patterns. Your task is to
apply a low-pass filter to the temperature data to reduce the noise and extract
the underlying trend.
Solution:
MATLAB example:
Problem 2:
Solution:
By following these steps, you can successfully apply signal filtering to the
synthetic non-Euclidean data, reducing the noise and obtaining a clearer
representation of the underlying signal. The filtering process enhances the
analysis and interpretation of the signal by emphasizing the desired
components and attenuating unwanted noise.
MATLAB example:
xlabel('Time');
ylabel('Amplitude');
subplot(2, 1, 2);
plot(t, filtered_signal);
title('Filtered Signal');
xlabel('Time');
ylabel('Amplitude');
Sensor and data fusion is a crucial aspect of signal processing that aims to
leverage information from multiple sensors or data sources to enhance
decision-making and system performance. Here is a more detailed
explanation of this concept:
Rhyme Summary:
In this chapter's pages, we explore. Signal processing's applications galore.
Audio and speech, we process with care. Transforming sounds into words,
so fair.
Images and videos come to life. Through processing, reducing their strife.
Layman's Guide:
In summary, this chapter highlights the broad range of signal processing
applications across different domains. From audio and speech processing to
image and video processing, biomedical signal processing, communications
and networking, and sensor and data fusion, signal processing techniques
are vital for extracting valuable insights, enhancing system performance,
and enabling advanced applications in each respective domain.
You are tasked with developing a signal processing system for a smart city
application. The system needs to address several key applications, including
environmental monitoring, energy management, intelligent traffic control,
and anomaly detection. Design a solution that incorporates signal processing
techniques to extract valuable insights, enhance system performance, and
enable advanced functionalities for each of these applications.
Solution:
1. Environmental Monitoring:
x Implement sensors to measure temperature and humidity
in different locations of the city.
x Use signal processing techniques such as smoothing and
normalization to process the sensor data.
x Analyze the processed data to monitor environmental
conditions and identify any anomalies or patterns.
2. Energy Management:
x Install smart energy meters to measure energy
consumption in residential and commercial buildings.
x Retrieve energy consumption data from the smart meters.
x Apply signal processing techniques such as peak
detection and average calculation to analyze the energy
consumption patterns.
190 Chapter IV
By considering these additional aspects in the solution, the smart city can
achieve comprehensive signal processing capabilities, enabling effective
monitoring, control, and optimization of various applications. The solution
will facilitate data-driven decision-making, resource efficiency, and
improved quality of life for the residents.
Problem 2:
Solution:
1. Attendance Monitoring:
x Utilize signal processing techniques to process data from
attendance tracking systems, such as RFID or biometric
sensors.
x Develop algorithms to accurately detect and identify
students' presence in the classroom.
x Apply signal processing techniques to analyze attendance
data, identify patterns, and generate reports for
administrative purposes.
2. Smart Lighting Control:
x Implement sensors to monitor lighting conditions in
classrooms and campus areas.
x Use signal processing techniques to adjust lighting levels
based on occupancy, natural lighting, and user preferences.
x Develop algorithms for energy-efficient lighting control,
ensuring optimal lighting conditions while minimizing
energy consumption.
3. Noise and Disturbance Detection:
x Deploy microphones or sound sensors to monitor noise
levels in classrooms, study areas, and common spaces.
x Apply signal processing algorithms to detect and classify
different types of noises, such as conversation, loud
noises, or disturbances.
x Implement real-time alert systems to notify administrators or
teachers about noise violations or potential disruptions.
4. Smart Lecture Capture:
x Utilize signal processing techniques to enhance the
quality of audio and video recordings during lectures.
x Apply noise reduction and speech enhancement algorithms
to improve the clarity of recorded lectures.
Applications of Signal Processing 193
Problem 3:
In the context of futuristic applications like the metaverse, how can signal
processing techniques be applied to enhance the immersive experience,
optimize data processing, and enable seamless interactions within virtual
environments? Develop a comprehensive solution that addresses audio
processing, video processing, user interactions, data integration, and real-
time communication within the metaverse.
Solution:
Problem 4:
You are working on a medical imaging project that aims to detect breast
cancer using ultra-wideband (UWB) signals. Your task is to design a
MATLAB script to generate a UWB signal and visualize the resulting image
of breast tissue. The script should also implement a thresholding technique
to detect the presence of cancer in the image.
Requirements:
Solution:
UWB signals are characterized by their extremely short duration and wide
bandwidth. They are commonly used in applications such as radar,
communications, and medical imaging. In medical imaging, UWB signals
can be employed for breast cancer detection due to their ability to provide
high-resolution images and better tissue differentiation.
MATLAB example:
% Parameters
Fs = 1e9; % Sample rate (1 GHz)
T = 1e-9; % Pulse duration (1 ns)
Fc = 3e9; % Center frequency (3 GHz)
B = 4e9; % Bandwidth (4 GHz)
threshold = 0.5; % Threshold for cancer detection
cancer_signal = zeros(size(t));
cancer_indices = t >= cancer_start_time & t <= (cancer_start_time +
cancer_duration);
cancer_signal(cancer_indices) = cancer_amplitude;
% Plot the UWB signal with cancer and the detection result in the same
figure
figure;
subplot(2, 1, 1);
plot(t, signal_with_cancer, 'b');
hold on;
plot(t, noisy_signal, 'r--');
title('UWB Signal with Cancer (Time)');
xlabel('Time');
ylabel('Amplitude');
legend('Signal with Cancer', 'Noisy Signal');
% Plot the UWB signal with cancer in the frequency domain (dB scale)
subplot(2, 1, 2);
f = linspace(-Fs/2, Fs/2, length(t));
signal_with_cancer_freq = fftshift(abs(fft(signal_with_cancer)));
plot(f, 20*log10(signal_with_cancer_freq), 'b');
hold on;
plot([min(f), max(f)], [20*log10(threshold), 20*log10(threshold)], 'k--');
title('UWB Signal Spectrum with Cancer (Frequency)');
xlabel('Frequency');
200 Chapter IV
ylabel('Magnitude (dB)');
xlim([-Fs/2, Fs/2]);
ylim([min(20*log10(signal_with_cancer_freq)),
max(20*log10(signal_with_cancer_freq))]);
Note that this simulation is for illustrative purposes only and does not
capture the full complexity of real cancer signals. In practice, cancer
detection requires more advanced techniques and accurate models based on
clinical data and imaging systems.
Problem 5:
Design a MATLAB script to generate 2-D images representing breast tissue
with and without cancer using UWB signals. The goal is to visualize the
differences between normal tissue and cancerous tissue. Write a script that
creates a 2-D grid and generates two images: one depicting breast tissue
202 Chapter IV
By generating and visualizing these 2-D images, the code allows for a visual
understanding of the differences between normal tissue and cancerous
tissue. It provides a means to analyze and compare the amplitude
distribution in different tissue regions, which can be beneficial for cancer
detection and classification purposes.
MATLAB example:
% Parameters
Nx = 200; % Number of pixels in x-direction
Ny = 200; % Number of pixels in y-direction
threshold = 0.5; % Threshold for cancer detection
Applications of Signal Processing 203
% Plot the image with cancer and the image without cancer
figure;
subplot(1, 2, 1);
imagesc(X(1,:), Y(:,1), image_with_cancer);
title('Image with Cancer');
xlabel('X');
ylabel('Y');
colormap(gca, [1 1 1; 1 0 0]); % White for normal tissue, red for cancerous
tissue
colorbar;
axis equal;
axis tight;
subplot(1, 2, 2);
imagesc(X(1,:), Y(:,1), image_without_cancer);
title('Image without Cancer');
xlabel('X');
ylabel('Y');
colormap(gca, [1 1 1; 0 0 1]); % White for normal tissue, blue for healthy
tissue
colorbar;
axis equal;
axis tight;
Figure 3-30: An example of a medical imaging project using 2-D images and UWB
signals for breast cancer detection.
CHAPTER V
Rhyme Summary:
In this chapter's quest. Signal processing's future we invest.
Layman's Guide:
In summary, this chapter delves into the future directions of signal
processing, exploring emerging techniques such as quantum signal
processing and signal processing for blockchain. It addresses the challenges
and opportunities that lie ahead, including the need for more efficient
algorithms and the importance of privacy and security considerations. The
chapter concludes by emphasizing the importance of ongoing research and
development in signal processing, highlighting its potential to drive
transformative advancements in technology and impact diverse fields.
CHAPTER VI
APPENDICES
For example, let us say you want to extract the melody from a recorded
piece of music. By using mathematical tools, you can analyze the pattern of
frequencies in the sound and identify the important features that make up
the melody. You can also remove any unwanted background noise from the
recording, making the melody clearer and more enjoyable to listen to.
% Compute DFT
X = fft(x);
% Plot the magnitude spectrum
plot(abs(X)); xlabel('Frequency'); ylabel('Magnitude');
% Compute FFT
X = fft(x);
% Plot the magnitude spectrum
plot(abs(X)); xlabel('Frequency'); ylabel('Magnitude');
% Compute Z-transform
X = ztrans(x, n, z);
% Plot the Z-transform
plot(X); xlabel('z'); ylabel('X(z)');
% Compute cross-correlation
Rxy = xcorr(x, y);
% Plot the cross-correlation function
plot(Rxy); xlabel('Time Lag'); ylabel('Cross-correlation');
214 Chapter VI
MATLAB Code:
Math Equation: The estimation of mean (ߤ) and variance (ߪ ଶ ) can be done
using the following sample mean and sample variance formulas:
MATLAB Code:
title('Noisy Signal');
xlabel('Time');
ylabel('Amplitude');
MATLAB Code:
Note that this is just one example of hypothesis testing in signal processing,
and there are various statistical tests and approaches that can be used
depending on the specific hypothesis and requirements.
Here are two examples that demonstrate the application of linear algebra in
signal processing:
218 Chapter VI
MATLAB Code:
disp('Eigenvectors:');
disp(V);
Please note that matrix operations in linear algebra can be complex and
depend on the specific problem at hand. The provided example is a
simplified illustration, and more advanced applications may involve larger
matrices and more intricate calculations.
MATLAB Code:
disp('Matrix U:');
disp(U);
disp('Matrix V:');
disp(V);
Please note that SVD can be applied to matrices of any size, and the
resulting U, S, and V matrices may have different dimensions depending on
the original matrix.
220 Chapter VI