Mercurial > hg > ltpda
view m-toolbox/test/test_phasetrack.m @ 33:5e7477b94d94 database-connection-manager
Add known repositories list to LTPDAPreferences
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Mon, 05 Dec 2011 16:20:06 +0100 |
parents | f0afece42f48 |
children |
line wrap: on
line source
function test_phasetrack() % TEST_PHASETRACK tests phasetrack() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DESCRIPTION: test of phasetracking for atan()-output % % % CALL: test_phasetrack; % % HISTORY: 16-05-2008 Monsky % Creation. % % VERSION: % $Id: test_phasetrack.m,v 1.1 2008/05/21 09:53:46 anneke Exp $ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Create tsdata with a sinewave pl = plist(); pl = append(pl, param('fs', 100)); pl = append(pl, param('nsecs', 5)); pl = append(pl, param('waveform', 'sine wave')); pl = append(pl, param('f', 0.2)); pl = append(pl, param('phi', 0)); % Create an original time series with range bigger than +-PI original_data = 3*pi*ao(pl); % generate time series from original data as measured by phasemeter % if phasemeter uses atan() instead of atan2() for phase calculation pm_data=atan(tan(original_data)); % apply phase tracking algorithm tracked_data=phasetrack(pm_data); iplot(original_data, pm_data, tracked_data, (original_data-tracked_data)); legend 'original data' 'phasemeter output data' 'phase-tracked data' 'diff (original-tracked data)' plot(tracked_data.hist) % figure % subplot(2,2,1) % plot(original_data) % subplot(2,2,2) % plot(pm_data) % subplot(2,2,3) % plot(tracked_data) % subplot(2,2,4) % plot((original_data-tracked_data))