fernandoandreotti / fecgsyn

FECGSYN toolbox for ECG and fetal ECG simulation
http://www.fecgsyn.com/
GNU General Public License v3.0
80 stars 26 forks source link

add_noisedipole #10

Closed fernandoandreotti closed 10 years ago

fernandoandreotti commented 10 years ago

Has a problem with sampling frequency under 360 Hz

fernandoandreotti commented 10 years ago

Confirmed. It looks like that the chunk of NSTDB is not big enough for the AR modelling. Check:

% == constants
AR_ORDER = 12; % number of poles
FS_NSTDB = 360; % sampling frequency of NSTDB
LG_NSTDB = FS_NSTDB*29; % number of points in NSTDB
NP_NSTDB = 20*FS_NSTDB; % number of points to select in NSTDB records to generate the AR     coefficients
N_SAMP = floor(N/(fs/FS_NSTDB)); % N samples at fs correspond to N_SAMP at FS_NSTDB
NB_EL = size(epos,1); % number of electrodes

% == randomly select noise interval of size LG_SEL
start = round(LG_NSTDB*rand);
stop = start + NP_NSTDB;

´´´´

fernandoandreotti commented 10 years ago

Problem was the number of randomly generated numbers for the AR modelling, added a max(N,N_SAMP), now should work.