From 235a4364361722b9df7639bd24227b8159e29be0 Mon Sep 17 00:00:00 2001 From: Karthik Chandrashekara Date: Wed, 4 Sep 2024 18:07:22 +0200 Subject: [PATCH] Added shot noise limit calculation to the MATLAB script. --- Time-Series-Analyzer/Analyzer.py | 6 +----- Time-Series-Analyzer/computeRIN.m | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Time-Series-Analyzer/Analyzer.py b/Time-Series-Analyzer/Analyzer.py index 75e1e7c..03ea5b5 100644 --- a/Time-Series-Analyzer/Analyzer.py +++ b/Time-Series-Analyzer/Analyzer.py @@ -273,7 +273,6 @@ def plot_psd(data, Sxx, data_str, peak_find = False, peak_find_threshold = -100, plt.legend(loc = 3, fontsize=12) plt.xlabel('Frequency [Hz]', fontsize=14) plt.ylabel('PSD [dB/Hz]', fontsize=14) - # plt.title('SNR= %.2f dB' % (SNR_f), fontsize=14) # Adjust layout plt.tight_layout() @@ -325,7 +324,6 @@ def plot_psd(data, Sxx, data_str, peak_find = False, peak_find_threshold = -100, plt.legend(loc = 3, fontsize=12) plt.xlabel('Frequency [Hz]', fontsize=14) plt.ylabel('PSD [dB/Hz]', fontsize=14) - # plt.title('SNR= %.2f dB' % (SNR_f), fontsize=14) # Adjust layout plt.tight_layout() @@ -378,7 +376,6 @@ def plot_rin(data, rin, data_str, peak_find = False, peak_find_threshold = -100, plt.legend(loc = 3, fontsize=12) plt.xlabel('Frequency [Hz]', fontsize=14) plt.ylabel('RIN [dB/Hz]', fontsize=14) - # plt.title('SNR= %.2f dB' % (SNR_f), fontsize=14) # Adjust layout plt.tight_layout() @@ -421,8 +418,7 @@ def plot_rin(data, rin, data_str, peak_find = False, peak_find_threshold = -100, plt.legend(loc = 3, fontsize=12) plt.xlabel('Frequency [Hz]', fontsize=14) plt.ylabel('RIN [dB/Hz]', fontsize=14) - # plt.title('SNR= %.2f dB' % (SNR_f), fontsize=14) - + # Adjust layout plt.tight_layout() diff --git a/Time-Series-Analyzer/computeRIN.m b/Time-Series-Analyzer/computeRIN.m index e0e8141..427a696 100644 --- a/Time-Series-Analyzer/computeRIN.m +++ b/Time-Series-Analyzer/computeRIN.m @@ -81,19 +81,31 @@ RIN_bg_smooth = 10*log10(spsd_bg_smooth /(average_P*delta_f)); f = f_s/2 * linspace(0,1,N/2+1); f_smooth = smooth(f,span,'moving'); +% Calculates the shot noise limit of the used PD given the wavelength of the light source and +% incident average power +PlanckConstant = 6.62607015E-34; +SpeedOfLight = 299792458; +WavelengthOfLaserLight = 1064E-9; +FrequencyOfLaserLight = SpeedOfLight / WavelengthOfLaserLight; +QuantumEfficiencyOfPD = 1; +ShotNoiseLimit = 10*log10((2 * PlanckConstant * FrequencyOfLaserLight / QuantumEfficiencyOfPD) * average_P); +%% Plots the RIN + % Plots the RIN vs frequency f_ = clf; figure(f_); semilogx(f_smooth,RIN_bg_smooth,'k-') hold on semilogx(f_smooth,RIN_src_smooth,'r-') +yline(ShotNoiseLimit,'--b'); xlabel('Frequency [Hz]') ylabel('RIN [dB/Hz]') -xlim([min(f) max(f)]); +xlim([10 max(f)]); title('\bf Relative Intensity Noise of ODT Arm 1') -legend('Background PD Box', 'Power:7 V, Mod:-3.0 V','Location','NorthEast'); +legend('Detector Noise', 'Power:7 V, Mod: 100%, with PID ON', 'Shot-Noise limit','Location','NorthWest'); % text(1e5,-95,['\bf MovingAverage = ' num2str(span) ]); grid on + % optional: save the picture without editing wherever you want %------------------------------------------% % saveas(f_,'FileName','png'); %