Why a DFT of 2 senes is very noisy even with frequence sampling 5 times bigger?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I've set up this case to try to understand DFT implementing a real case in Excel



Frame Size $;colorblue(T$): 5s

Time Sampling $;colorblue(TS$): 0,1s

Block Size $;colorblue(N = TT/TS+1)$: 51

Sampling Rate $;colorblue(FS = TT/TS+1)$: 10 Hz

Frequency Resolution $;colorblue(FR = FS/(N-1))$: 10 Hz



In time spectrum I have put just 2 sines functions added



The firt sine has amplitude $colorblue10$, phase $ colorbluepi/3$ and frequency $colorblue2$ Hz.
The second sine has amplitude $colorblue5$, phase $colorblue0$ and frequency $colorblue1$ Hz: $ colorbluequad ( n = 0; to ;50)$



$$ colorblueX_n = 10, sin(2pi t 2 + pi/3)+ 5, sin(2pi t 1)$$



So I have generated DFT values where $colorblue; k=-25; to; 25quad $ and $colorbluequad x_k=a_k + ib_k;$:



$$colorbluea_k = (1/N) ; Sigma_n=0,N-1 X_n cos(2 pi n k /N) $$
$$colorblueb_k = (1/N) ; Sigma_n=0,N-1 X_n sin(2 pi n k /N) $$



After, I've calculated module $colorblueA$ and phase $colorbluePhi$ for $ colorblue; ( n = 0; to ;50)$



$$colorblueA_k = sqrt(a_k)^2 + (b_k)^2 $$
$$colorbluePhi_k = atan2(b_k, a_k) $$



I consider in my analysis
$$colorblue Freq_k = k.FS/(N-1) $$



Now my doubt arise. In my understanding, the signal is concentrated in the values of frequencies $colorblue-1$ Hz, $colorblue-2$ Hz, $colorblue1$ Hz and $colorblue2$ Hz. The negative frequencies I disregard, of course. However, in short, the frequency spectrum is noisy. For instance, 2,2 Hz amplitude is around 25% of 2 Hz amplitude. Is it normal?



I'm working with frequence sampling $colorblue10$ Hz, five times than maximum detected frequency ($colorblue2$ Hz).



What's happening?



To check if I had made a mistake, I calculated the DTF inverse and the original signal was restored exactly!



The 51 time data



8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254



The 51 frequency data(Re(z), Im(z), |z|, $Phi$(z))



-5.263637 '0 5.263637 3.141593

-5.314757 -0.063296 5.315134 -3.129684

-5.419828 -0.105233 5.420849 -3.122179

-5.584893 -0.146679 5.586819 -3.115335

-5.820079 -0.18721 5.823089 -3.109438

-6.141195 -0.226094 6.145356 -3.104793

-6.572571 -0.262063 6.577794 -3.101742

-7.152188 -0.292879 7.158182 -3.100666

-7.941429 -0.314477 7.947653 -3.102014

-9.044978 -0.319143 9.050606 -3.106323

-10.655609 -0.291244 10.659588 -3.114267

-13.16968 -0.195814 13.171136 -3.126725

-17.549884 0.058287 17.549981 3.138271

-26.896351 0.781108 26.907691 3.112559

-59.796558 3.899924 59.923599 3.076465

236.776794 -27.737536 238.395933 -0.116615

39.035747 -7.643652 39.777066 -0.193365

20.897541 -6.877469 22.000155 -0.31794

13.648149 -8.410855 16.03167 -0.552292

8.065645 -15.103434 17.122159 -1.080299

49.193768 117.548971 127.427577 1.174448

12.76258 9.147941 15.702493 0.621898

10.335487 3.943791 11.062359 0.364525

9.304059 2.002477 9.517113 0.211992

8.810217 0.874123 8.853475 0.098893

8.660254 0 8.660254 0

8.810217 -0.874123 8.853475 -0.098893

9.304059 -2.002477 9.517113 -0.211992

10.335487 -3.943791 11.062359 -0.364525

12.76258 -9.147941 15.702493 -0.621898

49.193768 -117.548971 127.427577 -1.174448

8.065645 15.103434 17.122159 1.080299

13.648149 8.410855 16.03167 0.552292

20.897541 6.877469 22.000155 0.31794

39.035747 7.643652 39.777066 0.193365

236.776794 27.737536 238.395933 0.116615

-59.796558 -3.899924 59.923599 -3.076465

-26.896351 -0.781108 26.907691 -3.112559

-17.549884 -0.058287 17.549981 -3.138271

-13.16968 0.195814 13.171136 3.126725

-10.655609 0.291244 10.659588 3.114267

-9.044978 0.319143 9.050606 3.106323

-7.941429 0.314477 7.947653 3.102014

-7.152188 0.292879 7.158182 3.100666

-6.572571 0.262063 6.577794 3.101742

-6.141195 0.226094 6.145356 3.104793

-5.820079 0.18721 5.823089 3.109438

-5.584893 0.146679 5.586819 3.115335

-5.419828 0.105233 5.420849 3.122179

-5.314757 0.063296 5.315134 3.129684

-5.263637 0.021122 5.263679 3.13758










share|improve this question









New contributor




Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Hi! could you upload a signal and spectrum plot as well ?
    – Fat32
    59 mins ago










  • I did it. There is a best way to do it?
    – Paulo Buchsbaum
    36 mins ago














up vote
1
down vote

favorite












I've set up this case to try to understand DFT implementing a real case in Excel



Frame Size $;colorblue(T$): 5s

Time Sampling $;colorblue(TS$): 0,1s

Block Size $;colorblue(N = TT/TS+1)$: 51

Sampling Rate $;colorblue(FS = TT/TS+1)$: 10 Hz

Frequency Resolution $;colorblue(FR = FS/(N-1))$: 10 Hz



In time spectrum I have put just 2 sines functions added



The firt sine has amplitude $colorblue10$, phase $ colorbluepi/3$ and frequency $colorblue2$ Hz.
The second sine has amplitude $colorblue5$, phase $colorblue0$ and frequency $colorblue1$ Hz: $ colorbluequad ( n = 0; to ;50)$



$$ colorblueX_n = 10, sin(2pi t 2 + pi/3)+ 5, sin(2pi t 1)$$



So I have generated DFT values where $colorblue; k=-25; to; 25quad $ and $colorbluequad x_k=a_k + ib_k;$:



$$colorbluea_k = (1/N) ; Sigma_n=0,N-1 X_n cos(2 pi n k /N) $$
$$colorblueb_k = (1/N) ; Sigma_n=0,N-1 X_n sin(2 pi n k /N) $$



After, I've calculated module $colorblueA$ and phase $colorbluePhi$ for $ colorblue; ( n = 0; to ;50)$



$$colorblueA_k = sqrt(a_k)^2 + (b_k)^2 $$
$$colorbluePhi_k = atan2(b_k, a_k) $$



I consider in my analysis
$$colorblue Freq_k = k.FS/(N-1) $$



Now my doubt arise. In my understanding, the signal is concentrated in the values of frequencies $colorblue-1$ Hz, $colorblue-2$ Hz, $colorblue1$ Hz and $colorblue2$ Hz. The negative frequencies I disregard, of course. However, in short, the frequency spectrum is noisy. For instance, 2,2 Hz amplitude is around 25% of 2 Hz amplitude. Is it normal?



I'm working with frequence sampling $colorblue10$ Hz, five times than maximum detected frequency ($colorblue2$ Hz).



What's happening?



To check if I had made a mistake, I calculated the DTF inverse and the original signal was restored exactly!



The 51 time data



8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254



The 51 frequency data(Re(z), Im(z), |z|, $Phi$(z))



-5.263637 '0 5.263637 3.141593

-5.314757 -0.063296 5.315134 -3.129684

-5.419828 -0.105233 5.420849 -3.122179

-5.584893 -0.146679 5.586819 -3.115335

-5.820079 -0.18721 5.823089 -3.109438

-6.141195 -0.226094 6.145356 -3.104793

-6.572571 -0.262063 6.577794 -3.101742

-7.152188 -0.292879 7.158182 -3.100666

-7.941429 -0.314477 7.947653 -3.102014

-9.044978 -0.319143 9.050606 -3.106323

-10.655609 -0.291244 10.659588 -3.114267

-13.16968 -0.195814 13.171136 -3.126725

-17.549884 0.058287 17.549981 3.138271

-26.896351 0.781108 26.907691 3.112559

-59.796558 3.899924 59.923599 3.076465

236.776794 -27.737536 238.395933 -0.116615

39.035747 -7.643652 39.777066 -0.193365

20.897541 -6.877469 22.000155 -0.31794

13.648149 -8.410855 16.03167 -0.552292

8.065645 -15.103434 17.122159 -1.080299

49.193768 117.548971 127.427577 1.174448

12.76258 9.147941 15.702493 0.621898

10.335487 3.943791 11.062359 0.364525

9.304059 2.002477 9.517113 0.211992

8.810217 0.874123 8.853475 0.098893

8.660254 0 8.660254 0

8.810217 -0.874123 8.853475 -0.098893

9.304059 -2.002477 9.517113 -0.211992

10.335487 -3.943791 11.062359 -0.364525

12.76258 -9.147941 15.702493 -0.621898

49.193768 -117.548971 127.427577 -1.174448

8.065645 15.103434 17.122159 1.080299

13.648149 8.410855 16.03167 0.552292

20.897541 6.877469 22.000155 0.31794

39.035747 7.643652 39.777066 0.193365

236.776794 27.737536 238.395933 0.116615

-59.796558 -3.899924 59.923599 -3.076465

-26.896351 -0.781108 26.907691 -3.112559

-17.549884 -0.058287 17.549981 -3.138271

-13.16968 0.195814 13.171136 3.126725

-10.655609 0.291244 10.659588 3.114267

-9.044978 0.319143 9.050606 3.106323

-7.941429 0.314477 7.947653 3.102014

-7.152188 0.292879 7.158182 3.100666

-6.572571 0.262063 6.577794 3.101742

-6.141195 0.226094 6.145356 3.104793

-5.820079 0.18721 5.823089 3.109438

-5.584893 0.146679 5.586819 3.115335

-5.419828 0.105233 5.420849 3.122179

-5.314757 0.063296 5.315134 3.129684

-5.263637 0.021122 5.263679 3.13758










share|improve this question









New contributor




Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • Hi! could you upload a signal and spectrum plot as well ?
    – Fat32
    59 mins ago










  • I did it. There is a best way to do it?
    – Paulo Buchsbaum
    36 mins ago












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I've set up this case to try to understand DFT implementing a real case in Excel



Frame Size $;colorblue(T$): 5s

Time Sampling $;colorblue(TS$): 0,1s

Block Size $;colorblue(N = TT/TS+1)$: 51

Sampling Rate $;colorblue(FS = TT/TS+1)$: 10 Hz

Frequency Resolution $;colorblue(FR = FS/(N-1))$: 10 Hz



In time spectrum I have put just 2 sines functions added



The firt sine has amplitude $colorblue10$, phase $ colorbluepi/3$ and frequency $colorblue2$ Hz.
The second sine has amplitude $colorblue5$, phase $colorblue0$ and frequency $colorblue1$ Hz: $ colorbluequad ( n = 0; to ;50)$



$$ colorblueX_n = 10, sin(2pi t 2 + pi/3)+ 5, sin(2pi t 1)$$



So I have generated DFT values where $colorblue; k=-25; to; 25quad $ and $colorbluequad x_k=a_k + ib_k;$:



$$colorbluea_k = (1/N) ; Sigma_n=0,N-1 X_n cos(2 pi n k /N) $$
$$colorblueb_k = (1/N) ; Sigma_n=0,N-1 X_n sin(2 pi n k /N) $$



After, I've calculated module $colorblueA$ and phase $colorbluePhi$ for $ colorblue; ( n = 0; to ;50)$



$$colorblueA_k = sqrt(a_k)^2 + (b_k)^2 $$
$$colorbluePhi_k = atan2(b_k, a_k) $$



I consider in my analysis
$$colorblue Freq_k = k.FS/(N-1) $$



Now my doubt arise. In my understanding, the signal is concentrated in the values of frequencies $colorblue-1$ Hz, $colorblue-2$ Hz, $colorblue1$ Hz and $colorblue2$ Hz. The negative frequencies I disregard, of course. However, in short, the frequency spectrum is noisy. For instance, 2,2 Hz amplitude is around 25% of 2 Hz amplitude. Is it normal?



I'm working with frequence sampling $colorblue10$ Hz, five times than maximum detected frequency ($colorblue2$ Hz).



What's happening?



To check if I had made a mistake, I calculated the DTF inverse and the original signal was restored exactly!



The 51 time data



8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254



The 51 frequency data(Re(z), Im(z), |z|, $Phi$(z))



-5.263637 '0 5.263637 3.141593

-5.314757 -0.063296 5.315134 -3.129684

-5.419828 -0.105233 5.420849 -3.122179

-5.584893 -0.146679 5.586819 -3.115335

-5.820079 -0.18721 5.823089 -3.109438

-6.141195 -0.226094 6.145356 -3.104793

-6.572571 -0.262063 6.577794 -3.101742

-7.152188 -0.292879 7.158182 -3.100666

-7.941429 -0.314477 7.947653 -3.102014

-9.044978 -0.319143 9.050606 -3.106323

-10.655609 -0.291244 10.659588 -3.114267

-13.16968 -0.195814 13.171136 -3.126725

-17.549884 0.058287 17.549981 3.138271

-26.896351 0.781108 26.907691 3.112559

-59.796558 3.899924 59.923599 3.076465

236.776794 -27.737536 238.395933 -0.116615

39.035747 -7.643652 39.777066 -0.193365

20.897541 -6.877469 22.000155 -0.31794

13.648149 -8.410855 16.03167 -0.552292

8.065645 -15.103434 17.122159 -1.080299

49.193768 117.548971 127.427577 1.174448

12.76258 9.147941 15.702493 0.621898

10.335487 3.943791 11.062359 0.364525

9.304059 2.002477 9.517113 0.211992

8.810217 0.874123 8.853475 0.098893

8.660254 0 8.660254 0

8.810217 -0.874123 8.853475 -0.098893

9.304059 -2.002477 9.517113 -0.211992

10.335487 -3.943791 11.062359 -0.364525

12.76258 -9.147941 15.702493 -0.621898

49.193768 -117.548971 127.427577 -1.174448

8.065645 15.103434 17.122159 1.080299

13.648149 8.410855 16.03167 0.552292

20.897541 6.877469 22.000155 0.31794

39.035747 7.643652 39.777066 0.193365

236.776794 27.737536 238.395933 0.116615

-59.796558 -3.899924 59.923599 -3.076465

-26.896351 -0.781108 26.907691 -3.112559

-17.549884 -0.058287 17.549981 -3.138271

-13.16968 0.195814 13.171136 3.126725

-10.655609 0.291244 10.659588 3.114267

-9.044978 0.319143 9.050606 3.106323

-7.941429 0.314477 7.947653 3.102014

-7.152188 0.292879 7.158182 3.100666

-6.572571 0.262063 6.577794 3.101742

-6.141195 0.226094 6.145356 3.104793

-5.820079 0.18721 5.823089 3.109438

-5.584893 0.146679 5.586819 3.115335

-5.419828 0.105233 5.420849 3.122179

-5.314757 0.063296 5.315134 3.129684

-5.263637 0.021122 5.263679 3.13758










share|improve this question









New contributor




Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I've set up this case to try to understand DFT implementing a real case in Excel



Frame Size $;colorblue(T$): 5s

Time Sampling $;colorblue(TS$): 0,1s

Block Size $;colorblue(N = TT/TS+1)$: 51

Sampling Rate $;colorblue(FS = TT/TS+1)$: 10 Hz

Frequency Resolution $;colorblue(FR = FS/(N-1))$: 10 Hz



In time spectrum I have put just 2 sines functions added



The firt sine has amplitude $colorblue10$, phase $ colorbluepi/3$ and frequency $colorblue2$ Hz.
The second sine has amplitude $colorblue5$, phase $colorblue0$ and frequency $colorblue1$ Hz: $ colorbluequad ( n = 0; to ;50)$



$$ colorblueX_n = 10, sin(2pi t 2 + pi/3)+ 5, sin(2pi t 1)$$



So I have generated DFT values where $colorblue; k=-25; to; 25quad $ and $colorbluequad x_k=a_k + ib_k;$:



$$colorbluea_k = (1/N) ; Sigma_n=0,N-1 X_n cos(2 pi n k /N) $$
$$colorblueb_k = (1/N) ; Sigma_n=0,N-1 X_n sin(2 pi n k /N) $$



After, I've calculated module $colorblueA$ and phase $colorbluePhi$ for $ colorblue; ( n = 0; to ;50)$



$$colorblueA_k = sqrt(a_k)^2 + (b_k)^2 $$
$$colorbluePhi_k = atan2(b_k, a_k) $$



I consider in my analysis
$$colorblue Freq_k = k.FS/(N-1) $$



Now my doubt arise. In my understanding, the signal is concentrated in the values of frequencies $colorblue-1$ Hz, $colorblue-2$ Hz, $colorblue1$ Hz and $colorblue2$ Hz. The negative frequencies I disregard, of course. However, in short, the frequency spectrum is noisy. For instance, 2,2 Hz amplitude is around 25% of 2 Hz amplitude. Is it normal?



I'm working with frequence sampling $colorblue10$ Hz, five times than maximum detected frequency ($colorblue2$ Hz).



What's happening?



To check if I had made a mistake, I calculated the DTF inverse and the original signal was restored exactly!



The 51 time data



8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254

10.370375

0.687916

-5.189936

0.859809

8.660254

4.492522

-8.822649

-14.700502

-5.018043

8.660254



The 51 frequency data(Re(z), Im(z), |z|, $Phi$(z))



-5.263637 '0 5.263637 3.141593

-5.314757 -0.063296 5.315134 -3.129684

-5.419828 -0.105233 5.420849 -3.122179

-5.584893 -0.146679 5.586819 -3.115335

-5.820079 -0.18721 5.823089 -3.109438

-6.141195 -0.226094 6.145356 -3.104793

-6.572571 -0.262063 6.577794 -3.101742

-7.152188 -0.292879 7.158182 -3.100666

-7.941429 -0.314477 7.947653 -3.102014

-9.044978 -0.319143 9.050606 -3.106323

-10.655609 -0.291244 10.659588 -3.114267

-13.16968 -0.195814 13.171136 -3.126725

-17.549884 0.058287 17.549981 3.138271

-26.896351 0.781108 26.907691 3.112559

-59.796558 3.899924 59.923599 3.076465

236.776794 -27.737536 238.395933 -0.116615

39.035747 -7.643652 39.777066 -0.193365

20.897541 -6.877469 22.000155 -0.31794

13.648149 -8.410855 16.03167 -0.552292

8.065645 -15.103434 17.122159 -1.080299

49.193768 117.548971 127.427577 1.174448

12.76258 9.147941 15.702493 0.621898

10.335487 3.943791 11.062359 0.364525

9.304059 2.002477 9.517113 0.211992

8.810217 0.874123 8.853475 0.098893

8.660254 0 8.660254 0

8.810217 -0.874123 8.853475 -0.098893

9.304059 -2.002477 9.517113 -0.211992

10.335487 -3.943791 11.062359 -0.364525

12.76258 -9.147941 15.702493 -0.621898

49.193768 -117.548971 127.427577 -1.174448

8.065645 15.103434 17.122159 1.080299

13.648149 8.410855 16.03167 0.552292

20.897541 6.877469 22.000155 0.31794

39.035747 7.643652 39.777066 0.193365

236.776794 27.737536 238.395933 0.116615

-59.796558 -3.899924 59.923599 -3.076465

-26.896351 -0.781108 26.907691 -3.112559

-17.549884 -0.058287 17.549981 -3.138271

-13.16968 0.195814 13.171136 3.126725

-10.655609 0.291244 10.659588 3.114267

-9.044978 0.319143 9.050606 3.106323

-7.941429 0.314477 7.947653 3.102014

-7.152188 0.292879 7.158182 3.100666

-6.572571 0.262063 6.577794 3.101742

-6.141195 0.226094 6.145356 3.104793

-5.820079 0.18721 5.823089 3.109438

-5.584893 0.146679 5.586819 3.115335

-5.419828 0.105233 5.420849 3.122179

-5.314757 0.063296 5.315134 3.129684

-5.263637 0.021122 5.263679 3.13758







frequency-spectrum noise dft frequency






share|improve this question









New contributor




Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 36 mins ago





















New contributor




Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 hours ago









Paulo Buchsbaum

1064




1064




New contributor




Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Paulo Buchsbaum is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • Hi! could you upload a signal and spectrum plot as well ?
    – Fat32
    59 mins ago










  • I did it. There is a best way to do it?
    – Paulo Buchsbaum
    36 mins ago
















  • Hi! could you upload a signal and spectrum plot as well ?
    – Fat32
    59 mins ago










  • I did it. There is a best way to do it?
    – Paulo Buchsbaum
    36 mins ago















Hi! could you upload a signal and spectrum plot as well ?
– Fat32
59 mins ago




Hi! could you upload a signal and spectrum plot as well ?
– Fat32
59 mins ago












I did it. There is a best way to do it?
– Paulo Buchsbaum
36 mins ago




I did it. There is a best way to do it?
– Paulo Buchsbaum
36 mins ago










1 Answer
1






active

oldest

votes

















up vote
2
down vote













As far as I understood your question, you are complaining about the windowing effect and its consequence of smearing of the spectrum.



So you have a mathematically defined pure sine wave that extends from minus infinity to plus infinity in time, whose theoretical spectrum, you expect to be, a single line in frequency. But you eventually represent that infinitely long ideal sine wave with a finite length record (the windowed version, aka truncated) in practice and take the DFT of the finite length version instead. Then the result will be a broadened single line into a sinc waveform mostly having nonzero amplitudes at all frequencies in general which is what you called noise?



That's the most fundamental manifestation of the effect of time domain windowing (aka aperture effect) on the frequency spectrum; the smearing of the single frequency line and also leakage when multiple tones (including DC) co-exist.



So those are not noise, but an irrecoverable side effect of the practical utilization of finite length DFT. Note however that you might be adding your computational error on top of that. Hence for best verification, you better test your algorithm with an established library from Matlab / Octave kind of platforms.



The following plots are generated by Matlab from your uploaded data, to test your problem and it confirms with the explanation; i.e., those nonzero values you see in the spectrum are due to the windowing effect...



You cannot get rid of it but the effect will minimize by using longer data, however is not the most practical approach. Instead by using special window types such as Hamming, Hanning, Blackman, Kaiser etc, you can tradeoff certain features of it. Incidentally you are using a rectangular window, whose peaks are sharpest but those tails (side lobes) are also largest. All other windows will supress the tails (side lobes) but widen the peaks...



enter image description here



And this is the result of Hamming window applied to your data :



enter image description here



Note that your signal $x[n]$ seems 1 sample longer than it would be...






share|improve this answer






















  • I've uploaded the data in the question, but there is no computacional error, because I've got return with original data in Excel doing the IDFT. I program in MatLab but it's just dirty calculations.
    – Paulo Buchsbaum
    34 mins ago











Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "295"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Paulo Buchsbaum is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdsp.stackexchange.com%2fquestions%2f52449%2fwhy-a-dft-of-2-senes-is-very-noisy-even-with-frequence-sampling-5-times-bigger%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













As far as I understood your question, you are complaining about the windowing effect and its consequence of smearing of the spectrum.



So you have a mathematically defined pure sine wave that extends from minus infinity to plus infinity in time, whose theoretical spectrum, you expect to be, a single line in frequency. But you eventually represent that infinitely long ideal sine wave with a finite length record (the windowed version, aka truncated) in practice and take the DFT of the finite length version instead. Then the result will be a broadened single line into a sinc waveform mostly having nonzero amplitudes at all frequencies in general which is what you called noise?



That's the most fundamental manifestation of the effect of time domain windowing (aka aperture effect) on the frequency spectrum; the smearing of the single frequency line and also leakage when multiple tones (including DC) co-exist.



So those are not noise, but an irrecoverable side effect of the practical utilization of finite length DFT. Note however that you might be adding your computational error on top of that. Hence for best verification, you better test your algorithm with an established library from Matlab / Octave kind of platforms.



The following plots are generated by Matlab from your uploaded data, to test your problem and it confirms with the explanation; i.e., those nonzero values you see in the spectrum are due to the windowing effect...



You cannot get rid of it but the effect will minimize by using longer data, however is not the most practical approach. Instead by using special window types such as Hamming, Hanning, Blackman, Kaiser etc, you can tradeoff certain features of it. Incidentally you are using a rectangular window, whose peaks are sharpest but those tails (side lobes) are also largest. All other windows will supress the tails (side lobes) but widen the peaks...



enter image description here



And this is the result of Hamming window applied to your data :



enter image description here



Note that your signal $x[n]$ seems 1 sample longer than it would be...






share|improve this answer






















  • I've uploaded the data in the question, but there is no computacional error, because I've got return with original data in Excel doing the IDFT. I program in MatLab but it's just dirty calculations.
    – Paulo Buchsbaum
    34 mins ago















up vote
2
down vote













As far as I understood your question, you are complaining about the windowing effect and its consequence of smearing of the spectrum.



So you have a mathematically defined pure sine wave that extends from minus infinity to plus infinity in time, whose theoretical spectrum, you expect to be, a single line in frequency. But you eventually represent that infinitely long ideal sine wave with a finite length record (the windowed version, aka truncated) in practice and take the DFT of the finite length version instead. Then the result will be a broadened single line into a sinc waveform mostly having nonzero amplitudes at all frequencies in general which is what you called noise?



That's the most fundamental manifestation of the effect of time domain windowing (aka aperture effect) on the frequency spectrum; the smearing of the single frequency line and also leakage when multiple tones (including DC) co-exist.



So those are not noise, but an irrecoverable side effect of the practical utilization of finite length DFT. Note however that you might be adding your computational error on top of that. Hence for best verification, you better test your algorithm with an established library from Matlab / Octave kind of platforms.



The following plots are generated by Matlab from your uploaded data, to test your problem and it confirms with the explanation; i.e., those nonzero values you see in the spectrum are due to the windowing effect...



You cannot get rid of it but the effect will minimize by using longer data, however is not the most practical approach. Instead by using special window types such as Hamming, Hanning, Blackman, Kaiser etc, you can tradeoff certain features of it. Incidentally you are using a rectangular window, whose peaks are sharpest but those tails (side lobes) are also largest. All other windows will supress the tails (side lobes) but widen the peaks...



enter image description here



And this is the result of Hamming window applied to your data :



enter image description here



Note that your signal $x[n]$ seems 1 sample longer than it would be...






share|improve this answer






















  • I've uploaded the data in the question, but there is no computacional error, because I've got return with original data in Excel doing the IDFT. I program in MatLab but it's just dirty calculations.
    – Paulo Buchsbaum
    34 mins ago













up vote
2
down vote










up vote
2
down vote









As far as I understood your question, you are complaining about the windowing effect and its consequence of smearing of the spectrum.



So you have a mathematically defined pure sine wave that extends from minus infinity to plus infinity in time, whose theoretical spectrum, you expect to be, a single line in frequency. But you eventually represent that infinitely long ideal sine wave with a finite length record (the windowed version, aka truncated) in practice and take the DFT of the finite length version instead. Then the result will be a broadened single line into a sinc waveform mostly having nonzero amplitudes at all frequencies in general which is what you called noise?



That's the most fundamental manifestation of the effect of time domain windowing (aka aperture effect) on the frequency spectrum; the smearing of the single frequency line and also leakage when multiple tones (including DC) co-exist.



So those are not noise, but an irrecoverable side effect of the practical utilization of finite length DFT. Note however that you might be adding your computational error on top of that. Hence for best verification, you better test your algorithm with an established library from Matlab / Octave kind of platforms.



The following plots are generated by Matlab from your uploaded data, to test your problem and it confirms with the explanation; i.e., those nonzero values you see in the spectrum are due to the windowing effect...



You cannot get rid of it but the effect will minimize by using longer data, however is not the most practical approach. Instead by using special window types such as Hamming, Hanning, Blackman, Kaiser etc, you can tradeoff certain features of it. Incidentally you are using a rectangular window, whose peaks are sharpest but those tails (side lobes) are also largest. All other windows will supress the tails (side lobes) but widen the peaks...



enter image description here



And this is the result of Hamming window applied to your data :



enter image description here



Note that your signal $x[n]$ seems 1 sample longer than it would be...






share|improve this answer














As far as I understood your question, you are complaining about the windowing effect and its consequence of smearing of the spectrum.



So you have a mathematically defined pure sine wave that extends from minus infinity to plus infinity in time, whose theoretical spectrum, you expect to be, a single line in frequency. But you eventually represent that infinitely long ideal sine wave with a finite length record (the windowed version, aka truncated) in practice and take the DFT of the finite length version instead. Then the result will be a broadened single line into a sinc waveform mostly having nonzero amplitudes at all frequencies in general which is what you called noise?



That's the most fundamental manifestation of the effect of time domain windowing (aka aperture effect) on the frequency spectrum; the smearing of the single frequency line and also leakage when multiple tones (including DC) co-exist.



So those are not noise, but an irrecoverable side effect of the practical utilization of finite length DFT. Note however that you might be adding your computational error on top of that. Hence for best verification, you better test your algorithm with an established library from Matlab / Octave kind of platforms.



The following plots are generated by Matlab from your uploaded data, to test your problem and it confirms with the explanation; i.e., those nonzero values you see in the spectrum are due to the windowing effect...



You cannot get rid of it but the effect will minimize by using longer data, however is not the most practical approach. Instead by using special window types such as Hamming, Hanning, Blackman, Kaiser etc, you can tradeoff certain features of it. Incidentally you are using a rectangular window, whose peaks are sharpest but those tails (side lobes) are also largest. All other windows will supress the tails (side lobes) but widen the peaks...



enter image description here



And this is the result of Hamming window applied to your data :



enter image description here



Note that your signal $x[n]$ seems 1 sample longer than it would be...







share|improve this answer














share|improve this answer



share|improve this answer








edited 6 mins ago

























answered 1 hour ago









Fat32

12.2k31126




12.2k31126











  • I've uploaded the data in the question, but there is no computacional error, because I've got return with original data in Excel doing the IDFT. I program in MatLab but it's just dirty calculations.
    – Paulo Buchsbaum
    34 mins ago

















  • I've uploaded the data in the question, but there is no computacional error, because I've got return with original data in Excel doing the IDFT. I program in MatLab but it's just dirty calculations.
    – Paulo Buchsbaum
    34 mins ago
















I've uploaded the data in the question, but there is no computacional error, because I've got return with original data in Excel doing the IDFT. I program in MatLab but it's just dirty calculations.
– Paulo Buchsbaum
34 mins ago





I've uploaded the data in the question, but there is no computacional error, because I've got return with original data in Excel doing the IDFT. I program in MatLab but it's just dirty calculations.
– Paulo Buchsbaum
34 mins ago











Paulo Buchsbaum is a new contributor. Be nice, and check out our Code of Conduct.









 

draft saved


draft discarded


















Paulo Buchsbaum is a new contributor. Be nice, and check out our Code of Conduct.












Paulo Buchsbaum is a new contributor. Be nice, and check out our Code of Conduct.











Paulo Buchsbaum is a new contributor. Be nice, and check out our Code of Conduct.













 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdsp.stackexchange.com%2fquestions%2f52449%2fwhy-a-dft-of-2-senes-is-very-noisy-even-with-frequence-sampling-5-times-bigger%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

Installing NextGIS Connect into QGIS 3?

One-line joke