Signal Processing & Time-Series Analysis: From Transient Decay to Spectral Density

A dual approach to analyzing experimental time-series data: modeling transient decays in the time domain and extracting periodic components in the frequency domain. 실험 시계열 데이터를 이중 관점으로 분석합니다: 시간영역의 과도 감쇠 모델링과 주파수영역의 주기 성분 추출.

Python FFT Signal Processing Differential Equations

Project Overview프로젝트 개요

This project demonstrates a dual approach to analyzing experimental time-series data. I investigated the properties of dynamic systems using both Time-Domain modeling (fitting differential equations to transient signals) and Frequency-Domain analysis (extracting periodic components from noisy datasets).이 프로젝트는 실험 시계열 데이터를 이중 관점으로 분석합니다. 시간영역 모델링(과도 신호에 미분방정식 피팅)과 주파수영역 분석(노이즈 데이터에서 주기 성분 추출)을 함께 사용해 동적 시스템 특성을 조사했습니다.

Key Components핵심 구성

Part 1: Time-Domain Analysis (RLC Circuit)파트 1: 시간영역 분석 (RLC 회로)

Objective: Modeled the transient response of a Damped Harmonic Oscillator (RLC circuit).

Method: Applied non-linear curve fitting (scipy.optimize) to voltage data to extract decay constants ($\alpha$) and angular frequencies ($\omega$), verifying the solution to the differential equation $V(t) = V_0 e^{-\alpha t} \cos(\omega t)$.

Application: This mathematical framework is directly analogous to mean-reverting stochastic processes used in financial volatility modeling.

Source Code: Solar Cell FFT Analysis (`p5_hw7.py`)소스 코드: 태양전지 FFT 분석 (`p5_hw7.py`)

#!/usr/bin/env python3
#
# Using FFT method

import numpy as np
import matplotlib.pyplot as plt

#part (a)
FS = 920
input_filename = 'solarcell_data.txt'
print('Reading data from %s...' % input_filename)
data = np.loadtxt(input_filename)
print('Successfully read %d data points.' % len(data))
print()

#part (b)
npts = len(data)
data = data-np.mean(data) #removing DC components (average voltage)
ft = np.fft.fft(data, n=16*npts)
ftnorm = np.abs(ft)
ps = ftnorm**2
freqs = np.fft.fftfreq(len(ps), 1.0/FS)
time = np.arange(npts) /FS 
f1, ax1 = plt.subplots()
ax1.plot(time, data)
ax1.set_xlabel('Time (s)')
ax1.set_ylabel('Voltage (V)')
ax1.set_title('Solar Cell Voltage vs Time')
f1.show()

f2, ax2 = plt.subplots()
ax2.plot(freqs, ps)
ax2.set_xlim(0, 200)
ax2.set_xlabel('Frequency (Hz)')
ax2.set_ylabel('Power')
ax2.set_title('Power Spectrum of Solar Cell Signal')
f2.show()

# part (c)
eps_filename = 'power_spectrum_fft.eps'
print('Saving power spectrum to %s...' % eps_filename)
f2.savefig(eps_filename, format='eps')
print('Plot saved successfully.')
print()

real_freq = freqs > 0.5  # Exclude DC and very low frequencies
real_freqs = freqs[real_freq]
real_ps = ps[real_freq]

# Find the peak
max_idx = np.argmax(real_ps)
fundamental_freq = real_freqs[max_idx]
max_power = real_ps[max_idx]

print('Fundamental frequency: %.2f Hz' % fundamental_freq)
print('Power at fundamental frequency: %.2e' % max_power)
print()

input("Press  to exit...\n")

Part 2: Frequency-Domain Analysis (Solar FFT)파트 2: 주파수영역 분석 (태양전지 FFT)

Objective: Identified dominant frequency components in high-speed voltage sensor data.

Method: Implemented a Fast Fourier Transform (FFT) algorithm in Python to convert raw time-series data into a Power Spectral Density (PSD) plot, isolating signal from noise.

Application: Spectral analysis is a fundamental technique for identifying cyclical trends and filtering noise in market data.

Detailed Analysis (PDF)상세 분석 (PDF)

The full technical report, including mathematical derivations and detailed plots, is available below.

This inline viewer renders every page directly on the site, which avoids the clipped first-page issue and the browser PDF table-of-contents UI.이 인라인 뷰어는 모든 페이지를 사이트 안에서 직접 렌더링해 첫 페이지만 보이는 문제와 브라우저 PDF 목차 UI 문제를 피합니다.