<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Dear Bahar,
<div class=""><br class="">
</div>
<div class="">Perhaps you should first acquaint yourself a bit more with some of the basics of spectral analysis, and with some of the details of what the consequences are of specific choices about cfg-options that you specify before calling the function. Although
 you provide too few details to be sure, I suspect that you have a single stretch of data (sampled at 30K), i.e. a single trial, and I assume this to be of a certain length. If you want to create a single time-frequency spectrum, without epoching (again, I
 assume that this is what you want to do), this can become quite memory consuming, even when only considering the amount of memory it takes to store the results. In your case, you ask in cfg.toi to return an estimate of power for each time point in your original
 data. This is certainly an overkill, due to the temporal smoothness of the estimates. As a consequence, with 30.000 samples per second, and (e.g.) 15 minutes of recording each frequency’s time cours will have 27.000.000 samples. Since MATLAB needs 16 bytes
 for each complex-valued double precision number, this will eat up 432MB of memory. Per channel and per frequency…</div>
<div class="">Next, not specifying the frequency range, will cause FieldTrip to compute and return all frequencies, from 0 until the Nyquist frequency, which is 15.000 Hz in your case. Now, if you indeed have 15 minutes of recording, this gives you a spectral
 resolution of 1/900 Hz, i.e. 900 frequency estimates per Hz. This all amounts to 1350000 frequency bins to be estimated. I can imagine that computers may choke on this. </div>
<div class=""><br class="">
</div>
<div class="">I suggest to do the following:</div>
<div class=""><br class="">
</div>
<div class="">1) resample your data to a lower sampling rate, using ft_resampledata. If you go down to 2 or 4 kHz, no information is lost for the time being (at least not if you want to look up until 500 Hz).</div>
<div class="">2) ask for more reasonable parameters, e.g. cfg.toi = data.time{1}(1):0.1:data.time{1}(end); cfg.foi = 0:5:500; </div>
<div class="">3) think about the cfg.width parameter, and think twice whether you would want to use the ‘wavelet’ method, rather than ‘mtmconvol’, which gives you more control about the temporal integration window. Note that a width parameter of e.g. 5 (a typical,
 i think even the default, value) leads to the wavelet to be ~10 ms wide at 500 Hz, which may be a bit short.</div>
<div class=""><br class="">
</div>
<div class="">Best and good luck,</div>
<div class=""><br class="">
</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""> </div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 02 Sep 2016, at 21:45, Bahareh Elahian (belahian) <<a href="mailto:belahian@memphis.edu" class="">belahian@memphis.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="divtagdefaultwrapper" style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Hi All,</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">I am asking this question again since I tried on our<span class="Apple-converted-space"> </span><b class="">HPC server</b>, and still I need more memory for computation.</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Do you have any idea how can I plot my signal in time-frequency?</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">I wrote down the detail in my following post.</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Thanks!</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Bahar</div>
<br class="">
<div style="" class="">
<div dir="ltr" class=""><br class="">
<div class=""> </div>
</div>
<div class="">
<div style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class="">Hello All,</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">I am trying to apply wavelet on my signal to see HFOs in time-frequency plot.</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><u class="">The sampling rate of my signal is 30K. </u></div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><b class="">I will get an error: "</b></div>
<div class=""><b class="">Error using fft</b></div>
<div class=""><b class="">Out of memory. Type HELP MEMORY for your options.</b></div>
<div class=""><span style="font-size: 12pt;" class="">"</span><br class="">
</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div style="margin-top: 0px; margin-bottom: 0px;" class="">here is what I wrote according to<span class="Apple-converted-space"> </span><a href="http://www.fieldtriptoolbox.org/reference/ft_freqanalysis" class="OWAAutoLink" id="LPlnk404110">http://www.fieldtriptoolbox.org/reference/ft_freqanalysis</a>:</div>
<div id="LPBorder_GT_14728454719330.6747958041670916" style="margin-bottom: 20px; overflow: auto; width: 630px; text-indent: 0px;" class="">
<table id="LPContainer_14728454719270.9139918885440783" cellspacing="0" style="width: 567px; position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top-width: 1px; border-top-style: dotted; border-top-color: rgb(200, 200, 200); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(200, 200, 200); background-color: rgb(255, 255, 255);" class="">
<tbody class="">
<tr valign="top" style="border-spacing: 0px;" class="">
<td id="ImageCell_14728454719290.7429732386815968" colspan="1" style="width: 250px; position: relative; display: table-cell; padding-right: 20px;" class="">
<div id="LPImageContainer_14728454719290.6558539511974097" style="height: 150px; position: relative; margin: auto; display: table; width: 150px; background-color: rgb(255, 255, 255);" class="">
<a id="LPImageAnchor_14728454719300.19290236018320095" href="http://www.fieldtriptoolbox.org/reference/ft_freqanalysis" target="_blank" style="display: table-cell; text-align: center;" class=""><img aria-label="Preview image with link selected. Double-tap to open the link." id="LPThumbnailImageID_14728454719300.4611620808768795" width="150" height="150" src="http://www.fieldtriptoolbox.org/_media/logo-share.png" style="display: inline-block; max-width: 250px; max-height: 250px; height: 150px; width: 150px; border-width: 0px; vertical-align: bottom;" class=""></a></div>
</td>
<td id="TextCell_14728454719310.6668104683791809" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;" class="">
<div id="LPRemovePreviewContainer_14728454719310.7413848096018361" class=""></div>
<div id="LPTitle_14728454719310.5080183064967414" style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, 'Segoe UI Light', 'Segoe WP Light', 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; line-height: 21px;" class="">
<a id="LPUrlAnchor_14728454719310.6858708976509764" href="http://www.fieldtriptoolbox.org/reference/ft_freqanalysis" target="_blank" style="text-decoration: none;" class="">reference:ft_freqanalysis – FieldTrip</a></div>
<div id="LPMetadata_14728454719320.31841741741292817" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;" class="">
<a href="http://www.fieldtriptoolbox.org" class="">www.fieldtriptoolbox.org</a></div>
<div id="LPDescription_14728454719320.44875643525288234" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;" class="">
Note that this reference documentation is identical to the help that is displayed in MATLAB when you type “help ft_freqanalysis”. FT_FREQANALYSIS performs ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br class="">
<div style="margin-bottom: 20px; overflow: auto; width: 630px; text-indent: 0px;" class="">
<table cellspacing="0" style="width: 567px; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top-width: 1px; border-top-style: dotted; border-top-color: rgb(200, 200, 200); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(200, 200, 200); background-color: rgb(255, 255, 255);" class="">
<tbody class="">
<tr valign="top" style="border-spacing: 0px;" class="">
<td colspan="1" style="width: 250px; display: table-cell; padding-right: 20px;" class="">
<div style="height: 150px; margin: auto; display: table; width: 150px; background-color: rgb(255, 255, 255);" class="">
<a href="http://www.fieldtriptoolbox.org/reference/ft_freqanalysis" style="display: table-cell; text-align: center;" class=""><img width="150" height="150" src="http://www.fieldtriptoolbox.org/_media/logo-share.png" style="display: inline-block; max-width: 250px; max-height: 250px; height: 150px; width: 150px; border-width: 0px; vertical-align: bottom;" class=""></a></div>
</td>
<td colspan="2" style="vertical-align: top; padding: 0px; display: table-cell; position: relative;" class="">
<div class=""><a class="ms-Icon--x ms-icon-font-size-14" style="font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-weight: normal; position: relative; cursor: pointer; padding: 8px; float: right; color: rgb(102, 102, 102); -webkit-user-select: none; margin-left: 10px; background-color: rgb(244, 249, 253);"></a></div>
<div style="top: 0px; color: rgb(0, 120, 215); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, 'Segoe UI Light', 'Segoe WP Light', 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; line-height: 21px;" class="">
<a href="http://www.fieldtriptoolbox.org/reference/ft_freqanalysis" style="text-decoration: none;" class="">reference:ft_freqanalysis – FieldTrip</a></div>
<div style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;" class="">
<a href="http://www.fieldtriptoolbox.org/" class="">www.fieldtriptoolbox.org</a></div>
<div style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, 'Segoe UI', 'Segoe WP', Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;" class="">
Note that this reference documentation is identical to the help that is displayed in MATLAB when you type “help ft_freqanalysis”. FT_FREQANALYSIS performs ...</div>
</td>
</tr>
</tbody>
</table>
</div>
<br class="">
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><br class="">
</div>
<div style="margin-top: 0px; margin-bottom: 0px;" class=""><span style="font-size: 12pt;" class="">cfg= [];</span><br class="">
</div>
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div class="">cfg.pad = 'maxperlen';</div>
<div class="">cfg.method = 'wavelet';</div>
<div class="">cfg.output = 'pow';</div>
<div class="">%cfg.channel = 'chan 4';</div>
<div class=""> cfg.toi = (1:size(eeg.eeg_data,2))/Fs;</div>
<div class="">% cfg.foilim  = [80 500];</div>
<div class="">[freq] = ft_freqanalysis(cfg, data1);</div>
<br class="">
<p style="margin-top: 0px; margin-bottom: 0px;" class=""></p>
<div class="">
<div style="font-size: 12pt; background-color: rgb(255, 255, 255); font-family: Calibri, Arial, Helvetica, sans-serif;" class="">
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Tahoma; font-size: 13px;" class="">
Do you have any idea? is it realted to my sampling rate?</div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Tahoma; font-size: 13px;" class="">
Thanks!</div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Tahoma; font-size: 13px;" class="">
Bahar</div>
<div style="margin-top: 0px; margin-bottom: 0px; font-family: Tahoma; font-size: 13px;" class="">
<i class=""></i></div>
</div>
</div>
</div>
</div>
</div>
</div>
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="mailto:fieldtrip@donders.ru.nl" class="">fieldtrip@donders.ru.nl</a></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></span></div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>