Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 4dbf0ec391b877f21402aed9e8351fe8f7468d14 authored by D019 Rig on 19 December 2019, 23:25:22 UTC, committed by D019 Rig on 19 December 2019, 23:25:22 UTC
Update Calibration
1 parent 4cac1d4
  • Files
  • Changes
  • cb6e09d
  • /
  • Tools
  • /
  • VOR_Analysis
  • /
  • Needed for DR Temp
  • /
  • VORsineFitMaxMod.m
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:4dbf0ec391b877f21402aed9e8351fe8f7468d14
directory badge
swh:1:dir:5a46df886e2ed74cfdecda7a95375af60fe0bb4f
content badge
swh:1:cnt:4aac14bb913ca111dff0c9ee94f9ffa90520b12c

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
VORsineFitMaxMod.m
function [eyevelH_offset, eyevelH_rel_phase, eyevelH_amp, eyeHgain] = VOR_SineFit_Single(freq, sampleRate, eyeVel, headVel, drumVel)

% Segment data to current time segment
%dataseg = datseg(data, [tstart tstop]);

% Read in data
%if ~isempty(strfind([dataseg.chanlabel],'htvel'))
%    drumvel         = datchandata(dataseg,'htvel');
%else
%    drumvel = zeros(size(headVel));
%end

% define vector of time
ndatapoints = length(headVel);   % number of datapoints in segment
time = ((1:ndatapoints)-1)/sampleRate;

%% Set up variables for fitting data using a linear regression of Fourier Series
y1 = sin(2*pi*freq*time(:));
y2 = cos(2*pi*freq*time(:));
constant = ones(ndatapoints,1);
vars = [y1 y2 constant];
warning off

%% ======== FIT SINE FITS BASED ON DESACCADED TRACES =========
% fit data using a linear regression (data specified by 'keep_'index)
% b=coefficients, bint=95% confidence intervals, r=residual, rint=interval
% stats include 1)R-square, 2)F statistics, 3)p value 4)error variance
warning('off','stats:regress:NoConst') % No constant term bc sine centered at 0

% ------------CHAIR VELOCITY------------
[b,~,~,~,~] = regress(headVel, vars);
headH_amp = sqrt(b(1)^2+b(2)^2);
headH_angle = rad2deg(atan2(b(2), b(1)));

% ------------DRUM VELOCITY------------
[b,~,~,~,~] = regress(drumVel, vars);
drumH_amp = sqrt(b(1)^2+b(2)^2);
drumH_angle = rad2deg(atan2(b(2), b(1)));

% calculate eye gain as VOR or OKR based on head signal
if headH_amp > 3         % Chair signal
    refH_angle = headH_angle;
elseif drumH_amp >3      % No chair signal, drum signal
    refH_angle = drumH_angle;
else                    % No stimulus
    refH_angle = 0;
end

% ------------ EYE VELOCITY------------
[b,~,~,~,~] = regress(eyeVel, vars);
eyevelH_amp = sqrt(b(1)^2+b(2)^2);
eyevelH_phase = rad2deg(atan2(b(2), b(1)));
eyevelH_offset = b(3);

% ------------EYE RELATIVE TO CHAIR/DRUM------------
eyevelH_rel_phase = (eyevelH_phase - refH_angle);
eyevelH_rel_phase = mod(eyevelH_rel_phase,360) - 180;
eyeHgain = eyevelH_amp / headH_amp;

The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API