Fourier Series and Fourier Transform An Introduction Michael Figl Center for Medical Physics and Biomedical Engineering Medical University of Vienna 1 / 36
Introduction 2 / 36
Introduction We want to recall some definitions and theorems from linear algebra, mainly to clearly define the assumptions needed. 2 / 36
Some remarks on R n 3 / 36
Some remarks on R n We recall R n := {(a 1, a 2,...) : x i R} 3 / 36
Some remarks on R n We recall R n := {(a 1, a 2,...) : x i R} the standard basis consists of the vectors e i, with a 1 at position i, e i = (0,..., 0, 1, 0,..., 0) 3 / 36
Some remarks on R n We recall R n := {(a 1, a 2,...) : x i R} the standard basis consists of the vectors e i, with a 1 at position i, e i = (0,..., 0, 1, 0,..., 0) the inner product is defined by (x, y) := x i y i 3 / 36
Some remarks on R n We recall R n := {(a 1, a 2,...) : x i R} the standard basis consists of the vectors e i, with a 1 at position i, e i = (0,..., 0, 1, 0,..., 0) the inner product is defined by (x, y) := x i y i if we take a vector a = (a 1, a 2,...) we get (a, e i ) = a i 3 / 36
Some remarks on R n We recall R n := {(a 1, a 2,...) : x i R} the standard basis consists of the vectors e i, with a 1 at position i, e i = (0,..., 0, 1, 0,..., 0) the inner product is defined by (x, y) := x i y i if we take a vector a = (a 1, a 2,...) we get (a, e i ) = a i therefore a = (a, e i )e i 3 / 36
Some remarks on R n We recall R n := {(a 1, a 2,...) : x i R} the standard basis consists of the vectors e i, with a 1 at position i, e i = (0,..., 0, 1, 0,..., 0) the inner product is defined by (x, y) := x i y i if we take a vector a = (a 1, a 2,...) we get (a, e i ) = a i therefore a = (a, e i )e i 3 / 36
Some remarks on R n We recall R n := {(a 1, a 2,...) : x i R} the standard basis consists of the vectors e i, with a 1 at position i, e i = (0,..., 0, 1, 0,..., 0) the inner product is defined by (x, y) := x i y i if we take a vector a = (a 1, a 2,...) we get (a, e i ) = a i therefore a = (a, e i )e i What if we have many basis elements and don t want to sum everything up? 3 / 36
Best Approximation in R n, I 4 / 36
Best Approximation in R n, I Assume we have a vector r = N (r, e i )e i i=1 4 / 36
Best Approximation in R n, I Assume we have a vector r = N (r, e i )e i i=1 but as N is very big, we want just want to compute y = n (r, e i )e i, with n << N i=1 4 / 36
Best Approximation in R n, I Assume we have a vector r = N (r, e i )e i i=1 but as N is very big, we want just want to compute y = n (r, e i )e i, with n << N i=1 What can generally be said about y? 4 / 36
Best Approximation in R n, II r y = N i=n+1 (r, e i)e i V especially r y y y V for every y V 5 / 36
Best Approximation in R n, II r y = N i=n+1 (r, e i)e i V especially r y y y V for every y V Pythagoras theorem givens y r y r r y y V y r 2 = y r 2 + y y 2 5 / 36
Best Approximation in R n, II r y = N i=n+1 (r, e i)e i V especially r y y y V for every y V Pythagoras theorem givens y r y r r y y V y r 2 = y r 2 + y y 2 Theorem If we define V =< e i, i = 1,... n >, then y = n i=1 (r, e i)e i is the best approximation of r in V. 5 / 36
Generalisation 6 / 36
Generalisation What did we need to prove the approximation property? 6 / 36
Generalisation What did we need to prove the approximation property? an inner product space 6 / 36
Generalisation What did we need to prove the approximation property? an inner product space an orthogonal basis 6 / 36
Inner Product Space, I 7 / 36
Inner Product Space, I A not very surprising definition: 7 / 36
Inner Product Space, I A not very surprising definition: Definition (Inner Product Space) A vector space V (over the field F ), with an inner product (x, y) V V F is called an inner product space. 7 / 36
Inner Product Space, I A not very surprising definition: Definition (Inner Product Space) A vector space V (over the field F ), with an inner product (x, y) V V F is called an inner product space. The inner product is 7 / 36
Inner Product Space, I A not very surprising definition: Definition (Inner Product Space) A vector space V (over the field F ), with an inner product (x, y) V V F is called an inner product space. The inner product is symmetric (x, y) = (y, x) 7 / 36
Inner Product Space, I A not very surprising definition: Definition (Inner Product Space) A vector space V (over the field F ), with an inner product (x, y) V V F is called an inner product space. The inner product is symmetric (x, y) = (y, x) bilinear (x + λy, z) = (x, z) + λ(y, z) 7 / 36
Inner Product Space, I A not very surprising definition: Definition (Inner Product Space) A vector space V (over the field F ), with an inner product (x, y) V V F is called an inner product space. The inner product is symmetric (x, y) = (y, x) bilinear (x + λy, z) = (x, z) + λ(y, z) positive-definite x V \ {0} (x, x) > 0 7 / 36
Inner Product Space, II 8 / 36
Inner Product Space, II We can now define 8 / 36
Inner Product Space, II We can now define Definition Norm x := (x, x) 8 / 36
Inner Product Space, II We can now define Definition Norm x := (x, x) Orthogonality x y : (x, y) = 0 8 / 36
Inner Product Space, II We can now define Definition Norm x := (x, x) Orthogonality x y : (x, y) = 0 Angle x y := arccos (x,y) x y 8 / 36
Inner Product Space, Examples 9 / 36
Inner Product Space, Examples Example R n using (a, b) := a i b i 9 / 36
Inner Product Space, Examples Example using (a, b) := a i b i C[0, 1] using (f, g) := 1 0 fg R n 9 / 36
Inner Product Space, Examples Example using (a, b) := a i b i C[0, 1] using (f, g) := 1 0 fg C n using (a, b) := a i b i, sesquilinear! R n 9 / 36
Inner Product Space, Examples Example using (a, b) := a i b i C[0, 1] using (f, g) := 1 0 fg C n using (a, b) := a i b i, sesquilinear! l 2 := {(x i ) i N : < }, with (a, b) := R n xi 2 i=0 i=0 a i b i 9 / 36
Inner Product Space, Examples Example using (a, b) := a i b i C[0, 1] using (f, g) := 1 0 fg C n using (a, b) := a i b i, sesquilinear! l 2 := {(x i ) i N : < }, with (a, b) := R n xi 2 i=0 i=0 a i b i L 2 := {f measurable : f 2 < }, with (f, g) := f g 9 / 36
Bessel s Inequality 10 / 36
Bessel s Inequality Spaces like L 2 or l 2 have infinite dimensions, therefore the orthogonal system can also be infinite: e i, i = 1, 2,.... 10 / 36
Bessel s Inequality Spaces like L 2 or l 2 have infinite dimensions, therefore the orthogonal system can also be infinite: e i, i = 1, 2,.... Theorem (Bessel s inequality) f 2 (f, e i ) 2, i.e. the series ((f, e i )) i l 2 10 / 36
Bessel s Inequality Spaces like L 2 or l 2 have infinite dimensions, therefore the orthogonal system can also be infinite: e i, i = 1, 2,.... Theorem (Bessel s inequality) f 2 (f, e i ) 2, i.e. the series ((f, e i )) i l 2 0 (f n (f, e i )e i, f i=1 = f 2 2(f, = f 2 2 = f 2 i=1 n (f, e k )e k ) k=1 n n (f, e i )e i ) + ( (f, e i )e i, n (f, e i ) 2 + i,k i=1 n (f, e i ) 2 i=1 i=1 n (f, e k )e k ) k=1 (f, a i )(f, a k ) (e i, e k ) }{{} δ ik 10 / 36
L 2 [ π, π], Basis 11 / 36
L 2 [ π, π], Basis We know want to find an orthogonal basis for the L 2 [ π, π]. It will be based on trigonometric functions. 11 / 36
L 2 [ π, π], Basis We know want to find an orthogonal basis for the L 2 [ π, π]. It will be based on trigonometric functions. Theorem (orthogonality relations) for a, b N 1 π 1 π 1 π π π π π π π cos ax cos bx = sin ax sin bx = δ ab sin ax cos bx = 0 { 2 if a = b = 0 δ ab else 11 / 36
L 2 [ π, π], Basis We know want to find an orthogonal basis for the L 2 [ π, π]. It will be based on trigonometric functions. Theorem (orthogonality relations) for a, b N 1 π 1 π 1 π π π π π π π cos ax cos bx = sin ax sin bx = δ ab sin ax cos bx = 0 We search for the coefficients of { 2 if a = b = 0 δ ab else f (x) a 0 2 + k a k cos kx + k b k sin kx 11 / 36
L 2 [ π, π], Basis 12 / 36
L 2 [ π, π], Basis We search for the coefficients of f (x) a 0 2 + k a k cos kx + k b k sin kx 12 / 36
L 2 [ π, π], Basis We search for the coefficients of f (x) a 0 2 + k a k cos kx + k b k sin kx Theorem (Fourier Coefficients) for a, b N a k = 1 π b k = 1 π π π π π f (x) cos ax f (x) sin ax 12 / 36
Approximation of an Rectangle, I 13 / 36
Approximation of an Rectangle, I The simple rectangle function { 1, if π f (n) = 2 x π 2 0, else has the Fourier coefficients: n=1 13 / 36
Approximation of an Rectangle, I The simple rectangle function { 1, if π f (n) = 2 x π 2 0, else has the Fourier coefficients: n=2 13 / 36
Approximation of an Rectangle, I The simple rectangle function { 1, if π f (n) = 2 x π 2 0, else has the Fourier coefficients: n=3 13 / 36
Approximation of an Rectangle, I The simple rectangle function { 1, if π f (n) = 2 x π 2 0, else has the Fourier coefficients: n=4 13 / 36
Approximation of an Rectangle, I The simple rectangle function { 1, if π f (n) = 2 x π 2 0, else has the Fourier coefficients: for k 0 : a k = 1 π = sin kx kπ a 0 = 1, b k = 1 π π 2 π 2 π π π π f (x) cos kx = 1 π = 2 kπ sin k π 2 = f (x) sin kx = 0 π 2 π 2 cos kx { 0, if k is even k 1 2 kπ ( 1) 2, else n=5 13 / 36
Approximation of an Rectangle, I The simple rectangle function { 1, if π f (n) = 2 x π 2 0, else has the Fourier coefficients: for k 0 : a k = 1 π = sin kx kπ a 0 = 1, b k = 1 π π 2 π 2 π π π π f (x) cos kx = 1 π = 2 kπ sin k π 2 = f (x) sin kx = 0 π 2 π 2 cos kx { 0, if k is even k 1 2 kπ ( 1) 2, else n=10 13 / 36
Approximation of an Rectangle, I The simple rectangle function { 1, if π f (n) = 2 x π 2 0, else has the Fourier coefficients: for k 0 : a k = 1 π = sin kx kπ a 0 = 1, b k = 1 π π 2 π 2 π π π π f (x) cos kx = 1 π = 2 kπ sin k π 2 = f (x) sin kx = 0 π 2 π 2 cos kx { 0, if k is even k 1 2 kπ ( 1) 2, else n=20 13 / 36
Approximation of an Rectangle, II 14 / 36
Approximation of an Rectangle, II therefore the Fourier series for the rectangle function is f (x) = 1 2 + 2( 1) k 1 π k=1 cos(2k 1)x 2k 1 14 / 36
Approximation of an Rectangle, II therefore the Fourier series for the rectangle function is if we set x = 0 we get f (x) = 1 2 + 2( 1) k 1 π π 4 = k=1 k=1 cos(2k 1)x 2k 1 ( 1) k 1 2k 1 = 1 1 3 + 1 5 1 7... 14 / 36
Convergence of Fourier Series 15 / 36
Convergence of Fourier Series As seen with the rectangle function pointwise convergence cannot be expected everywhere (Gibbs phenomena), nevertheless 15 / 36
Convergence of Fourier Series As seen with the rectangle function pointwise convergence cannot be expected everywhere (Gibbs phenomena), nevertheless Theorem We denote by S n the Fourier series with n terms 15 / 36
Convergence of Fourier Series As seen with the rectangle function pointwise convergence cannot be expected everywhere (Gibbs phenomena), nevertheless Theorem We denote by S n the Fourier series with n terms L 2 norm f L 2 ; f S n = f S n 2 0 (Riesz-Fischer) 15 / 36
Convergence of Fourier Series As seen with the rectangle function pointwise convergence cannot be expected everywhere (Gibbs phenomena), nevertheless Theorem We denote by S n the Fourier series with n terms L 2 norm f L 2 ; f S n = f S n 2 0 (Riesz-Fischer) uniform f C 1 ; S n f uniformly (Dirichlet) 15 / 36
Convergence of Fourier Series As seen with the rectangle function pointwise convergence cannot be expected everywhere (Gibbs phenomena), nevertheless Theorem We denote by S n the Fourier series with n terms L 2 norm f L 2 ; f S n = f S n 2 0 (Riesz-Fischer) uniform f C 1 ; S n f uniformly (Dirichlet) pointwise f L 2 ; S n f pointwise a.e. (Carleson) 15 / 36
Convergence of Fourier Series As seen with the rectangle function pointwise convergence cannot be expected everywhere (Gibbs phenomena), nevertheless Theorem We denote by S n the Fourier series with n terms L 2 norm f L 2 ; f S n = f S n 2 0 (Riesz-Fischer) uniform f C 1 ; S n f uniformly (Dirichlet) pointwise f L 2 ; S n f pointwise a.e. (Carleson) 15 / 36
Convergence of Fourier Series As seen with the rectangle function pointwise convergence cannot be expected everywhere (Gibbs phenomena), nevertheless Theorem We denote by S n the Fourier series with n terms L 2 norm f L 2 ; f S n = f S n 2 0 (Riesz-Fischer) uniform f C 1 ; S n f uniformly (Dirichlet) pointwise f L 2 ; S n f pointwise a.e. (Carleson) with Riesz-Fischer we have Theorem (Parseval equality) f 2 = (f, e i ) 2, i.e. F : L 2 l 2 defined by f (f, e i ) i is isometric. 15 / 36
Complex Fourier Series 16 / 36
Complex Fourier Series using Eulers formula e ix = cos x + sin x 16 / 36
Complex Fourier Series using Eulers formula e ix = cos x + sin x we can rewrite the Fourier series f = with c 0 = a 0 2 n= c n = a n ib n 2 c n = a n + ib n 2 c n e inx for n > 0 for n > 0 16 / 36
Complex Fourier Series using Eulers formula e ix = cos x + sin x we can rewrite the Fourier series f = with respectively c 0 = a 0 2 n= c n = a n ib n 2 c n = a n + ib n 2 c n e inx for n > 0 for n > 0 c n = 1 π f (x)e inx 2π π 16 / 36
Complex Fourier Series Fourier Transform 17 / 36
Complex Fourier Series Fourier Transform we recall c k = 1 π f (x)e ikx, f = 2π π k= c k e ikx with a limiting process (extending the interval [ π, π] to [, ]) we get Definition (Fourier Transform) c(n) = 1 f (x)e inx dx, f (x) = c(n)e inx dn 2π n= 17 / 36
Fourier Transform 18 / 36
Fourier Transform Fourier transform for one and two variables (slightly changed notation): ˆf (k, s) = 1 2π ˆf (k) := 1 2π f (x)e ikx dx f (x, y)e i ( xy ) ( ) ks dx dy 18 / 36
Fourier Transform Fourier transform for one and two variables (slightly changed notation): ˆf (k, s) = 1 2π ˆf (k) := 1 2π f (x)e ikx dx f (x, y)e i ( xy ) ( ) ks dx dy The formulae for the inverse Fourier transform look similar, we have just to interchange f and ˆf and to cancel the " " from the exponent of the exponential function. 18 / 36
Fourier Transform, Basic Properties 19 / 36
Fourier Transform, Basic Properties Theorem linear λf + g λˆf + ĝ 19 / 36
Fourier Transform, Basic Properties Theorem linear λf + g λˆf + ĝ translation f (x + α) f (k)e ikα 19 / 36
Fourier Transform, Basic Properties Theorem linear λf + g λˆf + ĝ translation f (x + α) f (k)e ikα convolution f g ˆf ĝ 19 / 36
Fourier Transform, Basic Properties Theorem linear λf + g λˆf + ĝ translation f (x + α) f (k)e ikα convolution f g ˆf ĝ d differentiation n (dx) f (ik) n f (k) n 19 / 36
Fourier Transform, Basic Properties Theorem linear λf + g λˆf + ĝ translation f (x + α) f (k)e ikα convolution f g ˆf ĝ d differentiation n (dx) f (ik) n f (k) n eigenfunctions e ax2 1 2a e k2 /(4a) 19 / 36
Fourier Transform, Basic Properties Theorem linear λf + g λˆf + ĝ translation f (x + α) f (k)e ikα convolution f g ˆf ĝ d differentiation n (dx) f (ik) n f (k) n eigenfunctions e ax2 1 2a e k2 /(4a) isometry (f, g) = (ˆf, ĝ) 19 / 36
Discrete Fourier Transform (DFT) 20 / 36
Discrete Fourier Transform (DFT) The MATLAB implementation of the Fourier transform for one variable looks more like a complex Fourier series: X (k) := N j=1 x(j)e 2πi N (j 1)(k 1) 20 / 36
Discrete Fourier Transform (DFT) The MATLAB implementation of the Fourier transform for one variable looks more like a complex Fourier series: X (k) := N j=1 x(j)e 2πi N (j 1)(k 1) The first element of the X vector is the sum of all elements X (1) = N x(j) e 2πi N } (j 1)(1 1) {{} = j=1 =e 0 =1 N x(j) j=1 20 / 36
DFT of sin(k*x) in MATLAB To find the DFT of a sine wave in MATLAB, we have >> x=(0:127)/128*2*pi; >> fft(sin(x)) 0-64i 0... 0 64i >> fft(sin(5*x)) 0 0 0 0 0-64i 0... 0 64i 0 0 0 0 21 / 36
DFT of sin(k*x) in MATLAB To find the DFT of a sine wave in MATLAB, we have >> x=(0:127)/128*2*pi; >> fft(sin(x)) 0-64i 0... 0 64i >> fft(sin(5*x)) 0 0 0 0 0-64i 0... 0 64i 0 0 0 0 With the time difference τ between i and i + 1, the periodic time (time from 0 to N) is Nτ, therefore the frequency of the k th peak in the DFT is (k 1) f k = Nτ 21 / 36
DFT of sin(k*x) in MATLAB If we use sin(x) = eix e ix 2i for x = 2π N (j 1), j = 1,... N the DFT of sin(nx) is X (k) = = N j=1 j=1 x(j)e 2πi N (j 1)(k 1) N e n 2πi N (j 1) 2πi n e 2i = 1 N 2i j=1 = 1 N 1 2i j=0 N (j 1) e 2πi N (j 1)(n k+1) N 1 e 2πi N j(n k+1) j=0 e 2πi N (j 1)(k 1) N j=1 e 2πi N (j 1)( n k+1) e 2πi N j( n k+1) 22 / 36
DFT of sin(k*x) in MATLAB With the formula for the geometric series, we have N 1 (e 2πi N (n k+1) ) N 1 e 2πi N (n k+1)j = 0, if n k + 1 0 = e 2πi N (n k+1) 1 j=0 N, else, i.e. if k = n + 1 and N 1 j=0 e 2πi N ( n k+1)j = (e 2πi N ( n k+1) ) N 1 = 0, if N n k + 1 0 e 2πi N ( n k+1) 1 N, if k = N n + 1 E.g. for sin(7x) and N = 128, the DFT has X (8) = 64i, X (122) = 64i and all the other X (k) are zero. For cos(7x) we have X (8) = X (122) = 64 and all the other X (k) are zero. 23 / 36
Applications We present two applications 24 / 36
Applications We present two applications filtering of a noisy signal 24 / 36
Applications We present two applications filtering of a noisy signal determination of the main frequencies contained in a signal 24 / 36
Applications We present two applications filtering of a noisy signal determination of the main frequencies contained in a signal 24 / 36
Applications We present two applications filtering of a noisy signal determination of the main frequencies contained in a signal the examples were implemented in MATLAB 24 / 36
Low Pass Filtering - Noise Suppression We start with a mixture of two sinus signals, of different frequency and amplitude: 25 / 36
Low Pass Filtering - Noise Suppression We start with a mixture of two sinus signals, of different frequency and amplitude: >> x=(0:127)/128*4*pi; >> s = sin(2*x)+0.8*sin(15*x); >> plot(x,s) 25 / 36
Low Pass Filtering - Noise Suppression Then we compute the Fourier Transform 26 / 36
Low Pass Filtering - Noise Suppression Then we compute the Fourier Transform >> fs=fft(s); >> plot(abs(s)) 26 / 36
Low Pass Filtering - Noise Suppression Then we compute the Fourier Transform >> fs=fft(s); >> plot(abs(s)) The outer peaks are the low frequencies, the inner ones are the noise. 26 / 36
Low Pass Filtering - Noise Suppression Now we delete the peaks in the Fourier transform that were caused by noise. Then we apply the inverse Fourier transform and plot both the original together with the cleaned signal. 27 / 36
Low Pass Filtering - Noise Suppression Now we delete the peaks in the Fourier transform that were caused by noise. Then we apply the inverse Fourier transform and plot both the original together with the cleaned signal. >> fs_clean=fs; >> fs_clean[20:110]=0; >> s_clean=real(ifft(fs_clean)); >> plot(x,s,x,s_clean) 27 / 36
Heart- and Breathing Frequency using the DFT 28 / 36
Heart- and Breathing Frequency using the DFT During heart surgery (TECAB) a video sequence of the pericardium was made with an endoscope. 28 / 36
Heart- and Breathing Frequency using the DFT During heart surgery (TECAB) a video sequence of the pericardium was made with an endoscope. Our idea is 28 / 36
Heart- and Breathing Frequency using the DFT During heart surgery (TECAB) a video sequence of the pericardium was made with an endoscope. Our idea is 1. compare the first frame with the second, third, fourth, etc using an image comparision measure 28 / 36
Heart- and Breathing Frequency using the DFT During heart surgery (TECAB) a video sequence of the pericardium was made with an endoscope. Our idea is 1. compare the first frame with the second, third, fourth, etc using an image comparision measure 2. in-phase image frames are similar find prominent frequencies using the Fourier transform. 28 / 36
Loading the Video Frames We load 750 frames of size 768x576 of the video sequence: 29 / 36
Loading the Video Frames We load 750 frames of size 768x576 of the video sequence: >> frames = zeros(576,768,750); >> for k=1:750 filename =./slices/b- ; fn = sprintf( %s%05d.jpg,filename, k); im=double(imread(fn)); frames(:,:,k)= 0.3*im(:,:,1)+0.59*im(:,:,2)+0.11*im(:,:,3); end 29 / 36
Loading the Video Frames We load 750 frames of size 768x576 of the video sequence: >> frames = zeros(576,768,750); >> for k=1:750 filename =./slices/b- ; fn = sprintf( %s%05d.jpg,filename, k); im=double(imread(fn)); frames(:,:,k)= 0.3*im(:,:,1)+0.59*im(:,:,2)+0.11*im(:,:,3); end because of limited memory we converted the colour images to greyscale (luminance) via frames(:,:,k)=0.3*... (768*576*750 doubles are about 2.4 GB on a 64 bit machine) 29 / 36
Frame Comparison Function To compare the frames we use summed squared differences: 30 / 36
Frame Comparison Function To compare the frames we use summed squared differences: function res = ssd( i1, i2 ) res=sum(sum((i1-i2).^2)); 30 / 36
Frame Comparison Function To compare the frames we use summed squared differences: function res = ssd( i1, i2 ) res=sum(sum((i1-i2).^2)); and compute the difference from frame one to all the others: 30 / 36
Frame Comparison Function To compare the frames we use summed squared differences: function res = ssd( i1, i2 ) res=sum(sum((i1-i2).^2)); and compute the difference from frame one to all the others: >> ssdall=[]; >> for k=1:750; ssdall =[ssdall ssd(frames(:,:,1),frames(:,:,k))]; end 30 / 36
Frame Comparison Function 31 / 36
Frame Comparison Function The difference of frame one to the first frames is artificially small, we use only frames 13-750 31 / 36
Frame Comparison Function The difference of frame one to the first frames is artificially small, we use only frames 13-750 5.5 6 x 108 >> ssdsmall=ssdall(13:750); >> plot(sdssmall) ssd(slice 1, slice k ) 5 4.5 4 3.5 3 0 200 400 600 800 slice number 31 / 36
Derive the DFT 32 / 36
Derive the DFT The first component of the FFT is the sum of all elements, to avoid this we subtract the mean value. 32 / 36
Derive the DFT The first component of the FFT is the sum of all elements, to avoid this we subtract the mean value. We have 738 frames and 25 frames per second, τ = 1/25 = 0.04, the frequency of the k-th peak is f k = k 1 Nτ = k 1 29.52 Hz 2 (k 1) beats per minute 32 / 36
Derive the DFT The first component of the FFT is the sum of all elements, to avoid this we subtract the mean value. We have 738 frames and 25 frames per second, τ = 1/25 = 0.04, the frequency of the k-th peak is f k = k 1 Nτ = k 1 29.52 Hz 2 (k 1) beats per minute 8 x 109 >> ssdsmall=ssdall(13:750); >> fssd=fft(ssdsmall-mean(ssdsmall)); >> x=(0:40)./((738*0.04)/60); >> plot(x,abs(fssd(1:41))) 6 4 2 0 0 20 40 60 80 events per minute 32 / 36
Comparison with ECG 33 / 36
Comparison with ECG The first peak of the FFT is the respiration, the second the heart motion 33 / 36
Comparison with ECG The first peak of the FFT is the respiration, the second the heart motion The peaks are at k = 7, which is 12 bpm and at k = 27, which is 52 bpm. 8 x 109 6 4 2 0 0 20 40 60 80 events per minute 33 / 36
Sunspots Period 34 / 36
Sunspots Period Unfortunately not even the sun is free from ugly little spots. 34 / 36
Sunspots Period Unfortunately not even the sun is free from ugly little spots. A regular variation in the number of sunspots was described by Samuel Schwabe in 1843. 34 / 36
Sunspots Period Unfortunately not even the sun is free from ugly little spots. A regular variation in the number of sunspots was described by Samuel Schwabe in 1843. 34 / 36
Sunspots Period Unfortunately not even the sun is free from ugly little spots. A regular variation in the number of sunspots was described by Samuel Schwabe in 1843. Rudolf Wolf collected sunspot activity data and calculated a period of 11.1 years. To compare the data he defined the Wolf sche Relativzahl, also called sunspot number. 34 / 36
Sunspot Number 35 / 36
Sunspot Number The sunspot number is calculated by first counting the number of sunspot groups g and then the number of individual sunspots s. 35 / 36
Sunspot Number The sunspot number is calculated by first counting the number of sunspot groups g and then the number of individual sunspots s. Then SSN = 10 g + s 35 / 36
Sunspot Number 300 The sunspot number is calculated by first counting the number of sunspot groups g and then the number of individual sunspots s. Then SSN = 10 g + s SSN 200 100 0 0 1000 2000 3000 month 35 / 36
Sunspot Number The sunspot number is calculated by first counting the number of sunspot groups g and then the number of individual sunspots s. Then SSN = 10 g + s SSN 300 200 100 0 0 1000 2000 3000 month Since most sunspot groups have, on average, about ten spots, this formula for counting sunspots gives reliable numbers even when the observing conditions are less than ideal and small spots are hard to see. 35 / 36
Sunspot Number The sunspot number is calculated by first counting the number of sunspot groups g and then the number of individual sunspots s. Then SSN = 10 g + s SSN 300 200 100 0 0 1000 2000 3000 month Since most sunspot groups have, on average, about ten spots, this formula for counting sunspots gives reliable numbers even when the observing conditions are less than ideal and small spots are hard to see. Source solarscience.msfc.nasa.gov/sunspotcycle.shtml 35 / 36
Sunspot Cycle Length 36 / 36
Sunspot Cycle Length >> fs=abs(fft(ssnn)); >> plot(fs(1:100)) >> [C I]=max(fs(1:30))... I = 25 >> length(ssn) 3181 36 / 36
Sunspot Cycle Length >> fs=abs(fft(ssnn)); >> plot(fs(1:100)) >> [C I]=max(fs(1:30))... I = 25 >> length(ssn) 5 x 104 0 3181 0 20 40 60 80 100 4 3 2 1 36 / 36
Sunspot Cycle Length >> fs=abs(fft(ssnn)); >> plot(fs(1:100)) >> [C I]=max(fs(1:30))... I = 25 >> length(ssn) 0 3181 0 20 40 60 80 100 The maximum is at k = 25, 5 x 104 4 3 2 1 36 / 36
Sunspot Cycle Length >> fs=abs(fft(ssnn)); >> plot(fs(1:100)) >> [C I]=max(fs(1:30))... I = 25 >> length(ssn) 5 x 104 0 3181 0 20 40 60 80 100 The maximum is at k = 25, remember f k = k 1 Nτ, τ = 1/12, years are the time unit 4 3 2 1 36 / 36
Sunspot Cycle Length >> fs=abs(fft(ssnn)); >> plot(fs(1:100)) >> [C I]=max(fs(1:30))... I = 25 >> length(ssn) 5 x 104 0 3181 0 20 40 60 80 100 The maximum is at k = 25, remember f k = k 1 Nτ, τ = 1/12, years are the time unit >> f=(25-1)/(3181*1/12) f = 0.0905 >> 1/f 11.0451 4 3 2 1 36 / 36