I am using this MATLAB tutorial for Frequency-Domain Linear Regression. There is one part of code they provide, where it is necessary to determine the "frequency bin of the positive and negative frequency", for
freqbin = 72/12; freqbins = [freqbin 72-freqbin]+1; tsfit = zeros(72,1); tsfit(freqbins) = tsdft(freqbins); tsfit = ifft(tsfit); mu = mean(ts); tsfit = mu+tsfit;
Length of time series is $72$, and $12$ months is considered as one cycle.
- How can there be only one frequency bin for positive frequency?
- How do we know that it is exactly $72/12 + 1$ ($+1$ is because first bin is for zero frequency)? Is this some formula or what?