problem in reading my data in matlab from intan

4 views
Skip to first unread message

Kashish Parnami

unread,
Aug 27, 2025, 3:25:08 AM (9 days ago) Aug 27
to Open Ephys
When I record my data in intan software my data looks perfectly fine clean data but when I try to plot that in MATLAB it looks something different I have also shared my code for raw extraction and my intan data recording. Please help me.

fileinfo = dir('amplifier.dat');
num_samples = fileinfo.bytes/2;
fid = fopen('amplifier.dat', 'r');
v = fread(fid, num_samples, 'int16');
fclose(fid);
%v = v * 0.0000374; %convert to volts
v = v * 0.195; % convert to microvolts
%%%Time Data input
fileinfo = dir('time.dat');
num_samples = fileinfo.bytes/4; % int32 = 4 bytes
fid = fopen('time.dat', 'r');
t = fread(fid, num_samples, 'int32');
fclose(fid);
% t = t / frequency_parameters.amplifier_sample_rate; % sample rate from header file
t=t/20000;

%%%Sampling rate
fs=20000;
%%%Filtering
w=50/(fs/2);
bw=w;
[num,den]=iirnotch(w,bw);...implementation of notch filter
v_notch=filter(num,den,v);
fc=300;
[b,a]=butter(3,fc/(fs/2));...implementation of 3rd oder Butterworth filter
v_filtered=filter(b,a,v_notch);
v1=v-v_filtered;
%%%Plotting
figure, plot(t,v1,'k')

I am also getting one auxillary file as well is it something related to that.
live recording .png

Josh Siegle

unread,
Sep 1, 2025, 12:20:08 AM (4 days ago) Sep 1
to Kashish Parnami, Open Ephys
Hi Kashish,

Based on this code, it looks like you could be missing a `reshape` step – the matrix `v` needs to be reshaped to num_samples / num_channels x num_channels.

If that doesn't fix the problem, I'd recommend reaching out to Intan's support team.

Josh



--
You received this message because you are subscribed to the Google Groups "Open Ephys" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-ephys+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/open-ephys/cedd10a2-2a76-4d33-a452-33c58fcbd579n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages