-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
***** 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).
- Loading branch information
kianabc
committed
Oct 2, 2020
1 parent
5565d1d
commit dae8b45
Showing
3 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,43 @@ | ||
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 | ||
% [email protected] | ||
% 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 | ||
|
||
x = double(NSx.Data(channelNumber,:)); | ||
|
||
rng default; | ||
Fs = 300; | ||
Fs = NSx.MetaTags.SamplingFreq; | ||
t = linspace(0,1,length(x)); | ||
|
||
N = length(x); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters