summaryrefslogtreecommitdiff
path: root/getPeak.m
diff options
context:
space:
mode:
authorHunter Rew <hbrew@email.wm.edu>2014-04-23 22:44:37 -0400
committerHunter Rew <hbrew@email.wm.edu>2014-04-23 22:44:37 -0400
commitee48a590f2b518adc4d478f4c68c95fdfede8385 (patch)
tree68cbb275247c952d9b14cd9447ba2637aad40041 /getPeak.m
parentaddbb92ff06b21d2188eeefdb17692beb85e4b1c (diff)
downloadeit_filter_simulations-master.tar.gz
eit_filter_simulations-master.zip
Updated to latest versions of this codeHEADmaster
Diffstat (limited to 'getPeak.m')
-rw-r--r--getPeak.m28
1 files changed, 18 insertions, 10 deletions
diff --git a/getPeak.m b/getPeak.m
index 088a9ca..b074c73 100644
--- a/getPeak.m
+++ b/getPeak.m
@@ -1,4 +1,4 @@
-function [fwhm, absorption_min] = getPeak(detunings, absorptions)
+function [fwhm, absorption_min, contrast_left, contrast_right, features] = getPeak(detunings, absorptions)
eit_data = [detunings, absorptions];
@@ -27,16 +27,24 @@ function [fwhm, absorption_min] = getPeak(detunings, absorptions)
absorption_mid = (absorption_max + absorption_min) / 2;
half_width_right = interp1(eit_data(right_range,2), eit_data(right_range,1), absorption_mid) - eit_data(peak_center(1),1);
half_width_left = eit_data(peak_center(1),1) - interp1(eit_data(left_range,2), eit_data(left_range,1), absorption_mid);
- fwhm = half_width_right + half_width_left;
-
+ fwhm = half_width_right + half_width_left;
+ linewidth = [eit_data(peak_center(1),1)-half_width_left, absorption_mid; eit_data(peak_center(1),1)+half_width_right, absorption_mid];
+ left_max = [detunings(left_max(1)), left_max(2)];
+ right_max = [detunings(right_max(1)), right_max(2)];
+ peak_center = [detunings(peak_center(1)), peak_center(2)];
+ features = [left_max; peak_center; right_max; linewidth];
+ contrast_left = (left_max(2) - peak_center(2))/left_max(2);
+ contrast_right = (right_max(2) - peak_center(2))/right_max(2);
+
%Plot extrema over existing plot
- % plot(eit_data(:,1), eit_data(:,2));
- % hold all
- % grid on
- % plot(detuning_1(left_max(1)), left_max(2), 'r*')
- % plot(detuning_1(right_max(1)), right_max(2), 'r*')
- % plot(detuning_1(peak_center(1)), peak_center(2), 'g*')
-
+ % features = figure('visible', 'off');
+ % plot(
+ % eit_data(:,1), eit_data(:,2),
+ % detunings(left_max(1)), left_max(2), 'r*',
+ % detunings(right_max(1)), right_max(2), 'r*',
+ % detunings(peak_center(1)), peak_center(2), 'g*',
+ % linewidth(:,1), linewidth(:,2)
+ % );
end