Code covered by the BSD License  

Highlights from
Detrended Flucatuation Analysis (DFA) of Long-range temporal correlations

Detrended Flucatuation Analysis (DFA) of Long-range temporal correlations

by

 

25 Jan 2013 (Updated )

The DFA algorithm is a scaling analysis method used to estimate long-range temporal correlations.

nbt_Biomarker
% nbt_Biomarker(NumChannels) - Creates a biomarker object - this is the
% basic NBT biomarker object
%
% Usage:
%   >>  Biomarker = nbt_Biomarker(NumChannels);
%
% Inputs:
%   NumChannels -  Number of Channels
%
% Outputs:
%   Biomarker     - Biomarker object
%
% Example:
%
% References:
%
%
% See also:
%

%------------------------------------------------------------------------------------
% Originally created by Simon-Shlomo Poil (2009), see NBT website (http://www.nbtwiki.net) 
%------------------------------------------------------------------------------------


classdef nbt_Biomarker
    properties
        MarkerValues % the biomarker values
        NumChannels % number of channels
        Fs % The sampling frequency
        DateLastUpdate %last date this biomarker was updated
        PrimaryBiomarker % the primary biomarker to use in scripts
        Biomarkers % list of all biomarkers in the object
        BiomarkerUnits %list of biomarker units
        ReseacherID % ID of the Reseacher or script that made the last update
        ProjectID % The ID of the project which the biomarker belongs to
        SubjectID % The ID of the subject
        FrequencyRange %Frequency range of processed signal [] means broadband.
        Condition % The condition ID
        NBTversion
    end
    methods
        function BiomarkObject = nbt_Biomarker()
            BiomarkerObject.Condition = NaN;
            BiomarkerObject.DateLastUpdate =  datestr(now);
            BiomarkerObject.ReseacherID = NaN;
            BiomarkerObject.SubjectID = NaN;
            BiomarkerObject.ProjectID = NaN;
            BiomarkerObject.FrequencyRange = [];
            BiomarkerObject.Biomarkers = {'MarkerValues'};
            BiomarkerObject.NBTversion = 2;
        end
        
        function biomarkerObject=nbt_UpdateBiomarkerInfo(biomarkerObject, SignalInfo)
            biomarkerObject.DateLastUpdate = datestr(now);
            biomarkerObject.FrequencyRange = SignalInfo.frequencyRange;
            biomarkerObject.SubjectID = SignalInfo.subjectID;
            biomarkerObject.Condition = SignalInfo.condition;
            biomarkerObject.ProjectID = SignalInfo.projectID;
            biomarkerObject.Fs = SignalInfo.converted_sample_frequency;
            %set Badchannels to NaN
            if(~isempty(SignalInfo.BadChannels))
                for i=1:length(biomarkerObject.Biomarkers)
                    eval(['biomarker=biomarkerObject.' biomarkerObject.Biomarkers{1,i} ';']);
                    if(iscell(biomarker))
                        for m=1:length(biomarker)
                            if(~iscell(biomarker{m,1}))
                            biomarker{m,1}(find(SignalInfo.BadChannels)) = NaN;
                            else
                                for mm=1:length(biomarker{m,1})
                                    biomarker{m,1}{mm,1}(find(SignalInfo.BadChannels)) = NaN;
                                end
                            end
                        end
                    else
                        biomarker(find(SignalInfo.BadChannels)) = NaN;
                    end
                   eval(['biomarkerObject.' biomarkerObject.Biomarkers{1,i} '=biomarker;']);
               end
            end
        end
    end 
end

Contact us