Skip to content
Snippets Groups Projects
Verified Commit 88009f4e authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

feat(loadtunnel): remove trim from loadtunnel

parent 058a531c
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,6 @@ function tunnelData = loadtunnel(tunnelFile, cutoff) ...@@ -2,7 +2,6 @@ function tunnelData = loadtunnel(tunnelFile, cutoff)
% LOADTUNNEL Load the Wind Tunnel data and clean it. % LOADTUNNEL Load the Wind Tunnel data and clean it.
% This function loads the WindTunnel data. Then it: % This function loads the WindTunnel data. Then it:
% - applies a low-pass filter to clean the signal % - applies a low-pass filter to clean the signal
% - trim the instants before the flapping starts
% ----- % -----
% Output format: % Output format:
% The output array has one row per timestep. The columns are ordered as follows: % The output array has one row per timestep. The columns are ordered as follows:
...@@ -48,12 +47,8 @@ function tunnelData = loadtunnel(tunnelFile, cutoff) ...@@ -48,12 +47,8 @@ function tunnelData = loadtunnel(tunnelFile, cutoff)
% Calibrate % Calibrate
calibrated = calibrate(filtered); calibrated = calibrate(filtered);
% Trim
trimmed = trim(calibrated, SAMPLING); % TODO
% Return cleaned data % Return cleaned data
tunnelData = trimmed; tunnelData = calibrated;
end end
function rawTable = loadcsv(file) function rawTable = loadcsv(file)
...@@ -99,23 +94,3 @@ function filtered = filterwt(raw, cutoff, sampling) ...@@ -99,23 +94,3 @@ function filtered = filterwt(raw, cutoff, sampling)
% Apply filter % Apply filter
filtered = filtfilt(bb, aa, raw(:, :)); filtered = filtfilt(bb, aa, raw(:, :));
end end
function trimmed = trim(raw, sampling)
% TRIM Trim the raw data so they begin when motion is starting
% First we find the peaks in Fz. Then we cut everything up until un time the sampling rate
% before the first peak is found.
trimmed = raw;
maximums = max(raw);
for i = [3, 3 + 6]
[peaks{i}, locs{i}] = findpeaks(trimmed(:, i), 'MinPeakHeight', 0.05 * maximums(i));
end
firstPeakLoc = min(locs{3}(1), locs{3 + 6}(1));
% Trim
trimmed(1:max(firstPeakLoc - sampling, 0) + 1) = [];
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment