0% found this document useful (0 votes)
5 views2 pages

Program 2

The document contains a Python script that analyzes vibration data from a CSV file. It computes the Fast Fourier Transform (FFT) to visualize the time domain and frequency spectrum of the data, comparing healthy, unbalanced, and misaligned conditions. Finally, it calculates the root mean square (RMS) value to classify the engine condition as healthy, unbalanced, or misaligned/faulty.

Uploaded by

pavbakeprayag274
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Program 2

The document contains a Python script that analyzes vibration data from a CSV file. It computes the Fast Fourier Transform (FFT) to visualize the time domain and frequency spectrum of the data, comparing healthy, unbalanced, and misaligned conditions. Finally, it calculates the root mean square (RMS) value to classify the engine condition as healthy, unbalanced, or misaligned/faulty.

Uploaded by

pavbakeprayag274
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

import numpy as np

import pandas as pd
import [Link] as plt
from [Link] import fft, fftfreq
import os
path = [Link]([Link]("~"), "Desktop", "phy", "[Link]")
df = pd.read_csv(path)
print([Link]())
x = df.select_dtypes(include='number').iloc[:,0].values
fs = 1000
t = [Link](len(x))/fs
N = len(x)
f = fftfreq(N,1/fs)[:N//2]
F = lambda s: 2/N*[Link](fft(s)[:N//2])
u = x + 0.5*[Link](2*[Link]*25*t) # Unbalanced
m = x + 0.7*[Link](2*[Link]*100*t) # Misaligned
[Link](figsize=(9,6))
[Link](3,1,1); [Link](t[:500],x[:500]); [Link]("Time Domain"); [Link]()
[Link](3,1,2); [Link](f[:200],F(x)[:200]); [Link]("Frequency Spectrum");
[Link]()
[Link](3,1,3)
[Link](f[:200],F(x)[:200],label="Healthy")
[Link](f[:200],F(u)[:200],label="Unbalanced")
[Link](f[:200],F(m)[:200],label="Misaligned")
[Link](); [Link]("Spectrum Comparison"); [Link]()
plt.tight_layout(); [Link]()
rms = [Link]([Link](x**2))
cond = "HEALTHY" if rms<0.5 else "UNBALANCED" if rms<1 else
"MISALIGNED / FAULTY"
print("\nVIBRATION ANALYSIS RESULT")
print("RMS Value:",round(rms,4))
print("Engine Condition:",cond)

You might also like