From dae8b4507cdf15f1cc59ab10454d065f321aae91 Mon Sep 17 00:00:00 2001 From: kianabc Date: Fri, 2 Oct 2020 12:20:14 -0700 Subject: [PATCH] =?UTF-8?q?*****=20NPMK=20Version=205.4.2.0=20:October=202?= =?UTF-8?q?,=202020=20*****=20%=20%=201.1.0.0:=20NSxPowerSpectrum:=20Octob?= =?UTF-8?q?er=202,=202020=20%=20=20=20-=20Fixed=20a=20bug=20where=20the=20?= =?UTF-8?q?sampling=20frequency=20is=20now=20read=20from=20the=20header=20?= =?UTF-8?q?%=20=20=20=20=20file=20instead=20of=20it=20being=20fixed=20at?= =?UTF-8?q?=20300=20Hz.=20%=20%=207.3.1.0:=20openNSx:=20October=202,=20202?= =?UTF-8?q?0=20%=20=20=20-=20If=20the=20units=20are=20in=20=C2=B5V=20(open?= =?UTF-8?q?NSx('uv'),=20ths=20correct=20information=20is=20now=20%=20=20?= =?UTF-8?q?=20=20=20written=20to=20the=20electrodes=20header:=201000=20nV?= =?UTF-8?q?=20(raw).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NPMK/NSx Utilities/NSxPowerSpectrum.m | 32 ++++++++++++++++++++++++++- NPMK/Versions.txt | 12 +++++++++- NPMK/openNSx.m | 5 ++++- 3 files changed, 46 insertions(+), 3 deletions(-) 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