일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Big Data
- 김양재 목사
- Machine Learning
- 몽고디비
- 김양재
- MongoDB
- No SQL
- data science
- openCV
- 빅 데이타
- c++
- WebGL
- 빅 데이터
- node.js
- probability
- 딥러닝
- 확률
- Deep learning
- Statistics
- R
- nodeJS
- 빅데이타
- 데이터 과학
- 빅데이터
- 통계
- 인공지능
- 주일설교
- 우리들교회
- 김양재 목사님
- Artificial Intelligence
Archives
- Today
- Total
Scientific Computing & Data Science
[Programming / Signal Processing] Fourier Series 본문
Scientific Computing/Signal Processing
[Programming / Signal Processing] Fourier Series
cinema4dr12 2016. 5. 21. 13:20Fourier Series는 신호의 주파수 성분을 분석하는데 있어 매우 중요한 테크닉이다.
Fourier Series의 주요 개념은, 주기적인 신호는 무한개의 하모닉 함수 및 복소 지수(Complex Exponential)의 합으로 표현할 수 있다는 것이다.
가령, 주기 T0를 갖는 주기 신호 x(t)는 다음과 같이 정의된다:
...(1)
여기서,
ck : Fourier Series 계수
ω0 : (Fundamental Frequency)
kω0 : k-번째 하모닉의 주파수
k-번째 Fourier Series 계수 ck는 다음과 같이 계산된다:
...(2)
특히, c0를 DC 성분이라고 하는데, 한 개의 주기에 대한 x(t)의 평균값과 같기 때문이다.
...(3)
Euler 공식을 활용하면 (1)을 다음과 같이 sine과 cosine 성분으로 나눌 수 있다:
...(4)
여기서,
또는,
...(5)
여기서,
Cosine Series
인 우함수(Even Function)에 대하여
여기서,
Sine Series
인 기함수(Odd Function)에 대하여
여기서,
Example
기함수
에 대하여 Sine Series를 적용하면, 이므로
따라서,
k 값을 늘려갈 수록 원래의 함수에 점점 근접해 지는 것을 확인할 수 있다.
R Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | library(ggplot2) k <- 1 t <- seq(from = -pi, to = pi, by = 0.01) y <- rep(0.0, times = length(t)) yy <- rep(0.0, times = length(t)) cnt <- 0 for(x in t) { cnt <- cnt + 1; sum <- 0.0; for(i in 1:k) { sum <- sum + 2.0 / pi * (1 - (-1)^i) / i * sin(i * x); } y[cnt] <- sum; if(x < 0) { yy[cnt] <- -1.0; } else { yy[cnt] <- 1.0; } } mat <- matrix(c(t,y, yy), nrow = length(t), ncol = 3) df <- as.data.frame(mat) names(df) <- c("t", "y", "yy") ggplot(df, aes(t, y)) + geom_line() ggplot() + geom_line(data = df, aes(x = t, y = yy, colour="blue", size = 1)) + geom_line(data = df, aes(x = t, y = y, colour="red", size = 1)) | cs |
k = 1
k = 5
k = 10
k = 50
k = 1000
Comments