SNS Assignment
SNS Assignment
1 Problem Description
The equipment under monitoring functions correctly only if its output signal contains
frequency components of 25 Hz or less. Any significant frequency content above this
value may indicate a potential issue or departure from usual work conditions.
Considering:
• A second autonomous signal x[n], sampled at fs = 100 Hz.
• All major frequency components must be 25 Hz or less for normal operation.
Objective:
• Use signal processing to examine the frequency components of x[n].
• Identify any significant elements greater than 25 Hz.
• Provide suggestions on whether the machine should be maintained.
2 Methodology
2.1 Signal Preprocessing
• The given discrete-time signal x[n] has 116 samples.
• Sampling rate: fs = 100 Hz.
where:
• X[k] is the DFT coefficient at frequency bin k,
• N is the number of samples,
2π
• e−j N kn is the complex exponential basis function.
1
2.3 Code for Manual DFT and Analysis
Python Code:
import numpy as np
import matplotlib.pyplot as plt
x = np.array([
4, 1.8202, -1.3011, -0.8299, 1.6175, 1.7058, -0.1208, -0.1946,
1.3109, 0.8148, -1.809, -2.5833, -0.2369, 1.5469, 0.1716, -2.0691,
-2.2574, -1.1356, -0.7348, -0.821, -0.309, 0.1429, -0.4964, -1.3815,
-1.121, 0, 0.8718, 1.2568, 1.1933, 0.3364, -0.691, -0.187, 1.8204,
2.7626, 1.3448, -0.167, 0.3062, 1.1858, 0.42, -0.4442, 0.809, 2.2411,
0.5673, -2.5941, -2.5904, 0.5302, 1.7776, -0.6165, -2.5427, -1.3199,
0, -1.3199, -2.5427, -0.6165, 1.7776, 0.5302, -2.5904, -2.5941, 0.5673,
2.2411, 0.809, -0.4442, 0.42, 1.1858, 0.3062, -0.167, 1.3448, 2.7626,
1.8204, -0.187, -0.691, 0.3364, 1.1933, 1.2568, 0.8718, 0, -1.121,
-1.3815, -0.4964, 0.1429, -0.309, -0.821, -0.7348, -1.1356, -2.2574,
-2.0691, 0.1716, 1.5469, -0.2369, -2.5833, -1.809, 0.8148, 1.3109,
-0.1946, -0.1208, 1.7058, 1.6175, -0.8299, -1.3011, 1.8202, 4,
1.8202, -1.3011, -0.8299, 1.6175, 1.7058, -0.1208, -0.1946, 1.3109,
0.8148, -1.809, -2.5833, -0.2369, 1.5469, 0.1716, -2.0691
])
fs = 100 # Sampling frequency
N = len(x) # Number of samples
# Frequency bins
freqs = np.arange(N) * fs / N
2
plt.xlabel(’Frequency (Hz)’)
plt.ylabel(’Magnitude’)
plt.legend()
plt.grid(True)
plt.show()
# Final decision
if indices_high_freq.size > 0:
print("Prediction: Equipment REQUIRES maintenance (Significant components > 25 Hz
else:
print("Prediction: Equipment does NOT require maintenance.")
3 Observations
From the magnitude spectrum:
• Beyond 25 Hz: