Find a formula for the first harmonic

조회 수: 2 (최근 30일)
Alexander
Alexander 2015년 12월 3일
The procedure. We have a time-series (N last terms) x(1:N). Find Discrete Fourier Transfom h(1:N) = DFT(x). Find the Inverse DFT for the first harmonic (h(2) and h(N)) y(1:N). How to find a formula for the last term y(N)? I use the Symbolic Math TB:
syms N n x(n) k
h_term(n) = x(n) * exp(-2i*pi*(k-1)*(n-1)/N);
h(k) = symsum(h_term,n,1,N);
%h(2)
%h(N)
%y_term(k) = h(k) * exp(2i*pi*(k-1)*(n-1)/N);
yLast = (h(2) * exp(2i*pi*(N-1)/N) + h(N) * exp(2i*pi*(N-1)*(N-1)/N)) / N;
The formula contains i(=sqrt(-1)) but signals x and y are real. I need a simple formula for programming in C++ without complex numbers and expressions. How to find a simple formula with only sin & cos?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by