You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 20, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 20, 2024. It is now read-only.
Problem with opening file with load_open_ephys_data.m #66
@pranavswaroopgundla
Try something like this for a PSD:
Fs = 3e3; % sampling frequency
spect.winSize = 2^12; % window size
spect.win = blackman(spect.winSize);
spect.overlap = 0.8; % percentage window overlap
spect.nOverlap = floor(spect.winSize*spect.overlap);
spect.nFFT = 10*Fs; % number of fft samples, e.g. 10 per sample
figure;
spectrogram(sig, spect.win, spect.nOverlap, spect.nFFT, Fs, 'xaxis','psd');
colormap(hot)
Where sig is your signal for a given time period.
You can replace 'psd' with 'power' for a power spectrum. NOTE: Our data is actually sampled at 30e3, but as the resulting image takes too long to load we used a sampling rate x10 lower, meaning the frequency scale is also scaled.
Reacted by Pranav Swaroop Gundla and Shekhar Narayanan
I tried with code but the problem is i can't see the plot only. Its just
blank with a figure window can you help me with this problem.
Thank you in advance.
On Sun, May 26, 2019, 10:42 PM adehad ***@***.***> wrote:
@pranavswaroopgundla <https://github.com/pranavswaroopgundla>
Try something like this for a PSD:
Fs = 3e3; % sampling frequency
spect.winSize = 2^12; % window size
spect.win = blackman(spect.winSize);
spect.overlap = 0.8; % percentage window overlap
spect.nOverlap = floor(spect.winSize*spect.overlap);
spect.nFFT = 10*Fs; % number of fft samples, e.g. 10 per sample
figure;
spectrogram(sig, spect.win, spect.nOverlap, spect.nFFT, Fs, 'xaxis','psd');
colormap(hot)
Where sig is your signal for a given time period.
You can replace 'psd' with 'power' for a power spectrum.
*NOTE:* Our data is actually sampled at 30e3, but as the resulting image
takes too long to load we used a sampling rate x10 lower, meaning the
frequency scale is also scaled.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66?email_source=notifications&email_token=AHJ5TAHDBM7Q4UHU5QREKCTPXLAJLA5CNFSM4FC6FNG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWIJYIY#issuecomment-496016419>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHJ5TACEQNHKKW3WDIXVZKTPXLAJLANCNFSM4FC6FNGQ>
.
@adehad
the error is still there I don't know what is the causing an error
can u please give me ur mail id so that I can send my files to you so it might solve the problem faster.
Hmm, the error is saying that spect.winSize is greater than the length of your data. I notice that the DATA variable is now transposed in your workspace, so perhaps you need to pass in Data(:, 1), to select a single data channel.
On Mon, May 27, 2019 at 7:29 PM adehad ***@***.***> wrote:
Hmm, the error is saying that spect.winSize is greater than the length of
your data. I notice that the DATA variable is now transposed in your
workspace, so perhaps you need to pass in Data(:, 1), to select a single
data channel.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#66?email_source=notifications&email_token=AHJ5TAAIAIUXPDHQJD2RY6LPXPSNXA5CNFSM4FC6FNG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWJ4B3Q#issuecomment-496222446>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHJ5TAFJT5PPWHNXQHXN3L3PXPSNXANCNFSM4FC6FNGQ>
.
Activity
adehad commentedon Oct 20, 2018
The filename should be given in single quotes not double quotes as you have done.
e.g.
load_open_ephys_data('100_CH31.continuous');malenitzin commentedon Nov 28, 2018
adehad,
this works so well.
Thanks
psgundla commentedon Apr 8, 2019
after loading the files how can we plot power-spectrum and amplitude spectrum graphs for certain time period.
adehad commentedon May 26, 2019
@pranavswaroopgundla
Try something like this for a PSD:
Where
sigis your signal for a given time period.You can replace
'psd'with'power'for a power spectrum.NOTE: Our data is actually sampled at
30e3, but as the resulting image takes too long to load we used a sampling rate x10 lower, meaning the frequency scale is also scaled.psgundla commentedon May 27, 2019
adehad commentedon May 27, 2019
@pranavswaroopgundla What error message are you getting?
adehad commentedon May 27, 2019
Send a screenshot of the command window and the figure
psgundla commentedon May 27, 2019
@adehad

This is the error happening just take a look
the error is in ".png file"
powerspectrum.zip
and the figure is powerspectrum.zip
adehad commentedon May 27, 2019
spectrogramrequires a vector input, so try passing in a single row of yourDatavariable.psgundla commentedon May 27, 2019
@adehad

the error is still there I don't know what is the causing an error
can u please give me ur mail id so that I can send my files to you so it might solve the problem faster.
adehad commentedon May 27, 2019
Sorry I edited my comment, the function takes in a single channel of data, e.g.
Data(1,:)psgundla commentedon May 27, 2019
adehad commentedon May 27, 2019
Hmm, the error is saying that
spect.winSizeis greater than the length of your data. I notice that the DATA variable is now transposed in your workspace, so perhaps you need to pass inData(:, 1), to select a single data channel.psgundla commentedon May 27, 2019
adehad commentedon May 27, 2019
Yes, this is a common problem if you have a long recording.
There are a few ways of managing this:
Data(1:1e4, 1). This would plot the spectogram from the first 10,000 samples.spect.nFFT = 2*Fspsgundla commentedon May 29, 2019
@adehad it worked for me and thank you can you help how to plot the power spectrum graph for certain time limits in the signals.