-
Notifications
You must be signed in to change notification settings - Fork 2
/
Example2.m
29 lines (24 loc) · 916 Bytes
/
Example2.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%%% Example 2: Find both peak and trough: particle velocity data
clc; clear; close all;
% Load Data
[xMm, tMsec, displ] = MakeSimData(2);
data = MakeDataStruct(xMm, tMsec, displ);
% Apply Radon Transform
theta = CalcTheta(data.dxdt);
radout = NormRadon(data.data, theta);
% Find Peak
peak = FindRadonPeaks(radout);
trough = FindRadonPeaks(radout, true);
% Calculate Trajectory
p_out = CalcTrajectory(data, peak);
t_out = CalcTrajectory(data, trough);
p_res = CalcResolution(data, radout, peak);
t_res = CalcResolution(data, radout, trough);
fprintf('Peak Speed: %.2f m/s\n', p_out.speed)
fprintf('--Resolution_th: %.2f m/s\n', p_res.res_th)
fprintf('--Resolution_rp: %.2f m/s\n', p_res.res_rp)
fprintf('Trough Speed: %.2f m/s\n', t_out.speed)
fprintf('--Resolution_th: %.2f m/s\n', t_res.res_th)
fprintf('--Resolution_rp: %.2f m/s\n', t_res.res_rp)
% Plot
PlotRadon(1, data, radout, peak, p_out, trough, t_out)