--- Digital signal processing --- time domain : array of sampling times = [ 1 dt, 2 dt, 3 dt, ... , N dt ] longest time interval = T = N dt shortest time interval = dt example: 4 minute song at 44.1 kHz. N = ? frequency domain : what are the possible frequencies ? highest is [ 1, -1, 1, -1, ... , ] which has period = 2 dt, so f_high = 1/(2 dt) lowest periodic is [ 0 , ..., 1 , ... , 0 , ... , -1 , ... 0 ] which has a period of T = N dt, so f_low = 1/(N dt) just as multiples of shortest time gives all times, so multiples of this lowest are only possible frequences. But that gives 1/(N*dt) * ( 1, 2, 3, 4, ..., N/2) which is only half as much data as time points. What gives? Answer: each of these frequences comes in two phases, i.e. cosine and sine Caveat: actually, the high frequency only has one phase. But there's also a zero frequency, so we do get N frequencies. example: N = 4 time: (1 0 0 0) x amplitude_1 + (0 1 0 0) x amplitude_2 + (0 0 1 0) x amplitude_3 (0 0 0 1) x amplitude_4 freq: ( 1 1 1 1) x how_much_freq_0 + ( 1 -1 -1 1) x how_much_freq_1a (twice period of 2) + (-1 -1 1 1) x how_much_freq_1b (shifted 1/4 cyle) + ( 1 -1 1 -1) x how_much_freq_2 (highest = half of 4) Aside - a weird way to think of this : We can call the other phase a "negative frequency", which makes sense when you do all this with complex numbers, and otherwise is completely confusing. Then the frequency labels would be N = 4 : m=(-1,0,1,2), N = 8 : m=(-3,-2,-1,0,1,2,3,4) where the frequency f = m df = m/(N dt) --- filter --- Just a simple multiplication in frequency domain... So digital signal processing looks like this 1) start with [ y1, y2, y3, ...., yN ] at each time value 2) transform to [a1, a2, a3, ..., aN ] at each freq value 3) multiply (filter) by [ 1, 1, 1, 0, 0, 0, ] (low freq filter) or whatever 4) inverse transform back to time [ new_y1, new_y2, ... ] By the way, that transform is called "FFT" Fast Fourier Transform or "DFT" Discrete Fourier Transform and is also what's used in jpg images for compression