Signal Processing Study
Signal Processing Study
Normalisation
Essentially normalisation means adjusting given values to a set scale to enable comparison of data.
Feature Scaling:
𝑋 − 𝑋𝑚𝑖𝑛
𝑋′ =
𝑋𝑚𝑎𝑥 − 𝑋𝑚𝑖𝑛
Brings all values into the range [0,1]. It is also known as unity-based normalisation. It can be
generalised to restrict the values to any arbitrary points using a and b.
(𝑋 − 𝑋𝑚𝑖𝑛)(𝑏 − 𝑎)
𝑋′ = 𝑎 +
𝑋𝑚𝑎𝑥 − 𝑋𝑚𝑖𝑛
Octave
Filtering
Filtering data refers to extracting particular data points of relevance out of the data set, for example
peaks. The aim is to remove noise from the data to improve the signal-to-noise ratio.
Two types of filtering are low pass filters and high pass filters.
Low Pass filter: passes signals with a frequency lower than a certain cut-off frequency and
attenuated signals with frequencies higher than the cut-off frequency. E.g. simple moving average
SMA.
High Pass Filter: it passes signals with a frequency higher than a certain cut-off frequency and
attenuated signals with frequencies lower than the cut-off frequency
Depending on the requirement, either linear filters such as SMA or non-linear filters such as median
filter can be used. Some common types are Kalman filter, recursive least square filter, least mean
square filter, Wiener-Kolmogorov filters.
Noise reduction can be achieved in both the time domain as well as frequency domain.
Types of filtering include: peak threshold, peak threshold + window, Root Mean Square, Moving
Average and Kalman filter.
Peak Threshold
Set a minimal value and find all the values in signal data that are above that threshold.
Define: minimal value (Threshold T)
Disadvantges =
- Threshold is not always constant
- On a single step, multiple clause are above the given threshold
Octave
Set a minimum threshold, get the indices of the data points over the threshold.
dataThreshold = 0.5;
idxOverThreshold = data>dataThreshold;
indices = 1:length(idxOverThreshold); %creates a index set from 1 to the count of values
that are over the threshold
xIdxVector = indices(idxOverThreshold==1);
yIdxVector = data(idxOverThreshold==1);
%to Graph
plot(data)
plot(xIdxVector, yIdxVector, ‘r+’);
Octave
Create a function to find position of peaks over a threshold in a given data set, search set for local
maximum. (can also just use code and input the variables without function)
function peaklist = SimplePeakFind (environment, data, thresh)
listlength= length(data);
peaklist = zeros(lostlength,1); % creates blank output
SearchEnvHalf = max(1,floor(environment/2));
dataAboveThresh = find(data>=thresh);
for CandidateIndx = 1:length(dataAboveThresh)
Idx = dataAboveThresh(CandidateIdx);
end
if (maxIdx>listlength)
maxIdx = listlength;
end
end
end
peaklist = peaklist(find(peaklist));
end
Plotting Samples:
Find peaks in a dataset with window of 25 data points that are bigger than 0.15
%PLOT
figure
plot(dataset)
plot(xindx, yindx, “o”)
𝑁
1
𝑋𝑅𝑀𝑆 = √ ∑ |𝑋𝑛 |2
𝑁
𝑛=1
RMS is the root-mean-square value of a signal. For a digitised signal, you can calculate it by squaring
each value, finding the arithmetic mean of those squared values, and taking the square root of the
result.
Moving Average
Define: Range in samples (window size W)
Octave
wndw = 200; %choose size of moving average window
a=1;
b=(1/wndw)*ones(1,wndw);
data_filtered = filter(b, a, data);
Kalman filter
Complex filter for 2D/3D GPS Data Smoothing