<div dir="ltr"><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Dear FieldTrip Community,</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">I am encountering a specific issue while conducting time-frequency analysis using the ft_freqanalysis function with wavelet decomposition. Through my readings of previous tutorials and email discussions within the community, I understand that the NaN values appearing at the boundaries of my time segments in the output power spectrum are likely due to insufficient data at the data borders. However, I am particularly keen to learn how to resolve these NaN values, as the power values at the time boundaries are crucial for my analysis and cannot be disregarded.<br></p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Here is an excerpt of my code for reference:</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">EEG = pop_epoch( EEG, { '2 ' }, [-1 1.502], 'newname', 'EEProbe continuous data epochs', 'epochinfo', 'yes');<br>ft_data = eeglab2fieldtrip(EEG, 'preprocessing', 'none');<br>cfg = [];<br>cfg.channel = 'all';<br>cfg.method = 'tfr';<br>cfg.output = 'pow';<br>cfg.foi = 3:0.29:30;<br>cfg.toi = -1:0.002:1.5;<br>cfg.width = 3;<br>cfg.keeptrials = 'yes';<br>subj_data_tf = ft_freqanalysis(cfg, ft_data);
</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">My inquiries are twofold:</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Is there a way to adjust parameters within the <code style="border:0px solid rgb(217,217,227);box-sizing:border-box;font-size:0.875em;font-weight:600;font-family:"S\0000f6hne Mono",Monaco,"Andale Mono","Ubuntu Mono",monospace">ft_freqanalysis</code> function, such as interpolation, zero-padding, or other methods, to eliminate the NaN values at the edges of the time segments in the power spectrum?</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">If it's not feasible to resolve these NaN values directly within <code style="border:0px solid rgb(217,217,227);box-sizing:border-box;font-size:0.875em;font-weight:600;font-family:"S\0000f6hne Mono",Monaco,"Andale Mono","Ubuntu Mono",monospace">ft_freqanalysis</code>, does FieldTrip offer any other functions (similar to <code style="border:0px solid rgb(217,217,227);box-sizing:border-box;font-size:0.875em;font-weight:600;font-family:"S\0000f6hne Mono",Monaco,"Andale Mono","Ubuntu Mono",monospace">ft_interpolatenan</code>, which seems not applicable in this case) that can address NaN values in the output of time-frequency analysis?</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Any insights, suggestions, or guidance on how to tackle this issue would be greatly appreciated. I'm particularly interested in understanding if there's a standard approach within the FieldTrip framework for dealing with such NaN values.</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Thank you in advance for your time and assistance.</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Best regards,</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">Chengyuan Wu</p><p style="border:0px solid rgb(217,217,227);box-sizing:border-box;margin:1.25em 0px;color:rgb(55,65,81);font-family:Söhne,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Ubuntu,Cantarell,"Noto Sans",sans-serif,"Helvetica Neue",Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:16px">
</p></div>