diff --git a/NPMK/NSx Utilities/NSxPowerSpectrum.m b/NPMK/NSx Utilities/NSxPowerSpectrum.m index c10d0e6..a030017 100644 --- a/NPMK/NSx Utilities/NSxPowerSpectrum.m +++ b/NPMK/NSx Utilities/NSxPowerSpectrum.m @@ -1,5 +1,35 @@ function NSxPowerSpectrum(NSx, channelNumber, colorCode) +% NSxPowerSpectrum +% +% Plots a power spectrum of a given channel. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Use NSxPowerSpectrum +% +% Use settingsManager(NSx, channelNumber, colorCode) +% +% NSx: The NSx file containing the data. +% +% channelNumber: The channel to be plotted. +% +% colorCode: The color of the plot. This follows the standard "plot" +% colors in MATLAB. See "help plot" for more information. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Kian Torab +% support@blackrockmicro.com +% Blackrock Microsystems +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Version History +% +% 1.1.0.0: October 2, 2020 +% - Fixed a bug where the sampling frequency is now read from the header +% file instead of it being fixed at 300 Hz. +% + +function NSxPowerSpectrum(NSx, channelNumber, colorCode) + if ~exist('colorCode', 'var') colorCode = 'b'; end @@ -7,7 +37,7 @@ function NSxPowerSpectrum(NSx, channelNumber, colorCode) x = double(NSx.Data(channelNumber,:)); rng default; -Fs = 300; +Fs = NSx.MetaTags.SamplingFreq; t = linspace(0,1,length(x)); N = length(x); diff --git a/NPMK/Versions.txt b/NPMK/Versions.txt index dbcbe3b..4cad264 100644 --- a/NPMK/Versions.txt +++ b/NPMK/Versions.txt @@ -449,5 +449,15 @@ NPMK Version 2.8.2.0: 5 May 2014 % - Fixed a bug where the response to 1/4 uV warning was not being saved. % +***** NPMK Version 5.4.2.0 :October 2, 2020 ***** +% +% 1.1.0.0: NSxPowerSpectrum: October 2, 2020 +% - Fixed a bug where the sampling frequency is now read from the header +% file instead of it being fixed at 300 Hz. +% +% 7.3.1.0: openNSx: October 2, 2020 +% - If the units are in µV (openNSx('uv'), ths correct information is now +% written to the electrodes header: 1000 nV (raw). + -LATEST:5.4.1.0 \ No newline at end of file +LATEST:5.4.2.0 \ No newline at end of file diff --git a/NPMK/openNSx.m b/NPMK/openNSx.m index 71d2442..16d4730 100644 --- a/NPMK/openNSx.m +++ b/NPMK/openNSx.m @@ -260,6 +260,9 @@ % - If the units are in "raw", ths correct information is now written to % the electrodes header: 250 nV (raw). % +% 7.3.1.0: October 2, 2020 +% - If the units are in µV (openNSx('uv'), ths correct information is now +% written to the electrodes header: 1000 nV (raw). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Defining the NSx data structure and sub-branches. @@ -530,7 +533,7 @@ NSx.ElectrodesInfo(headerIDX).MinAnalogValue = typecast(ExtendedHeader((27:28)+offset), 'int16'); NSx.ElectrodesInfo(headerIDX).MaxAnalogValue = typecast(ExtendedHeader((29:30)+offset), 'int16'); if strcmpi(waveformUnits, 'uV') - NSx.ElectrodesInfo(headerIDX).AnalogUnits = char(ExtendedHeader((31:46)+offset))'; + NSx.ElectrodesInfo(headerIDX).AnalogUnits = '1000 nV (raw) '; else NSx.ElectrodesInfo(headerIDX).AnalogUnits = '250 nV (raw) '; end