<html><head><base href="x-msg://55/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Federico,<div><br></div><div>yes, the plot you sent have sawtooths curves because of low frequency trends. I am not sure of the mathematical reason this is happening. I think it might be due to numerical inaccuracies and limitation of the size of double precision number. In any case, high passing the data at 0.5 or 1 Hz always solves the problem. We will put a note on the command line in case users experience this problem.</div><div><br></div><div>Best regards,</div><div><br></div><div>Arno</div><div><br><div><div>On Jun 16, 2011, at 7:48 AM, Federico Gabriel Arguissain wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="DA" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Dear all,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">I have been trying to plot the spectra of an EEG register (raw data) with “Plot-> Plot spectra and maps”, which uses the pwelch function. The register was sampled at 512 Hz, saved on a cnt file and imported using the ANT plugin (v1.09). I selected a 100% of data to sample and a frequency range of 0 to 256 Hz to plot. For the topoplot() function I used the default options (according to the Command window it uses: windows length  512, fft length 1024, overlap 0)<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">I found out that the PSD plot showed a response more similar to the Hamming window than the PSD of the signal. Even changing the overlap the response was the same or even worse.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">It turned out that only when putting the same window length and fft length ( 512 and 512, 1024 and 1024, etc.) the PSD function had the shape of a “realistic” recording. Also removing the DC improved a lot the plot.<br>My partner José Biurrun Manresa tried to obtain the PSD without using the EEGLAB interface and I obtained the same results with this register. What really improved the obtained plot was detrending the signal:<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-family: Arial, sans-serif; ">plot(10*log10(pwelch(detrend(EEG.data(1,:)))))<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Probably would be a good idea to suggest detrending the signal or removing the offset before plotting the spectra of raw data. Any suggestion on this would be great. Thanks in advance.<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Best regards,<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US">Federico Arguissain<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US"><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 9pt; color: rgb(31, 73, 125); ">----------------------------------------------<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 9pt; color: rgb(31, 73, 125); ">Federico Gabriel Arguissain, Ph.D. fellow<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 9pt; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 9pt; color: rgb(31, 73, 125); ">Center for Sensory-Motor Interaction - SMI<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 9pt; color: rgb(31, 73, 125); ">Department of Health Science and Technology - HST<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9pt; color: rgb(31, 73, 125); ">Aalborg University<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9pt; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9pt; color: rgb(31, 73, 125); ">Fredrik Bajers Vej 7E-1, DK-9220 Aalborg E, Denmark<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 9pt; color: rgb(31, 73, 125); ">phone:  +45 9940 9762<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 9pt; color: rgb(31, 73, 125); ">email:<span class="Apple-converted-space"> </span><a href="mailto:fga@hst.aau.dk" style="color: blue; text-decoration: underline; "><span style="color: blue; ">fga@hst.aau.dk</span></a><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9pt; color: rgb(31, 73, 125); ">Skype: federico.arguissain<o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span lang="EN-US" style="font-size: 9pt; color: rgb(31, 73, 125); "><a href="http://www.smi.hst.aau.dk/" style="color: blue; text-decoration: underline; "><span lang="DA" style="color: blue; ">http://www.smi.hst.aau.dk/</span></a></span><u><span style="color: blue; "><o:p></o:p></span></u></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><span style="font-size: 9pt; color: rgb(31, 73, 125); ">----------------------------------------------</span><span style="color: rgb(31, 73, 125); "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-bottom: 0.0001pt; margin-left: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div></div><span><uploads-2011-06-16_1321.txt></span><span><PSD S1S1_cond1b_default_1.png></span><span><PSD S1S1_cond1b_default_enlarge.png></span><span><PSD S1S1_cond1b_nfft 512 winsize 512.png></span><span><PSD S1S1_cond1b_nfft 512 winsize 512_enlarge.png></span>_______________________________________________<br>Eeglablist page:<span class="Apple-converted-space"> </span><a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" style="color: blue; text-decoration: underline; ">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>To unsubscribe, send an empty email to<span class="Apple-converted-space"> </span><a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" style="color: blue; text-decoration: underline; ">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>For digest mode, send an email with the subject "set digest mime" to<span class="Apple-converted-space"> </span><a href="mailto:eeglablist-request@sccn.ucsd.edu" style="color: blue; text-decoration: underline; ">eeglablist-request@sccn.ucsd.edu</a></div></span></blockquote></div><br></div></body></html>