I have a histogramme who represent the max amplitude of 3000 signal + noise and this come from infrared detector. so, the signal is a number of photon. I want to normalized the histogram in function of the number of photon. Thus if I take 0 photon I only get the noise. But When I done all of that I get the same hstogramme with juste a different standard deviation and if I choose 0 photon I have a Dirac and not just my noise so I’m a little bit lost to what I need (other histo, new parameter, more data ???).
I hope someone have a solution maybe with the use of this parameters ?
Maybe use the parameters : SNR = mean(Amax)/Std or QEFR = SNR/Nbph or F= QE/QEFR with QE is the quantum efficency and SNR singnal noise ration.
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import gamma
from scipy.signal import convolve
# Quantum Efficiency
QE = 0.72
k1 = 6
# Optical power and number of photons
optical_power_dBm = 77.12
num_photons = 37
# File paths for the files containing the maximum amplitudes
file_amplitude_max_with = r'C:***amplitudes_max_signal_bruit_9V_C1.txt'
file_amplitude_max_without = r'C:***amplitudes_max_signal_bruit_9V_C1_sans.txt'
# Load maximum amplitudes from files
amplitudes_max_noise_with = np.loadtxt(file_amplitude_max_with)
amplitudes_max_noise_without = np.loadtxt(file_amplitude_max_without)
# Normalize amplitudes to rotate around 1
mean_amplitude_with = np.mean(amplitudes_max_noise_with)
mean_amplitude_without = np.mean(amplitudes_max_noise_without)
# Normalize amplitudes to rotate around 1 photon
normalized_amplitudes_max_noise_with = amplitudes_max_noise_with / (mean_amplitude_with * 37)
normalized_amplitudes_max_noise_without = amplitudes_max_noise_without / (mean_amplitude_without * 37)
normalized_amplitudes_max_noise_with = normalized_amplitudes_max_noise_with * 37
normalized_amplitudes_max_noise_with10 = normalized_amplitudes_max_noise_with * 10
normalized_amplitudes_max_noise_with1 = normalized_amplitudes_max_noise_with * 20
normalized_amplitudes_max_noise_without = normalized_amplitudes_max_noise_without * 37
# Calculate the standard deviations of the normalized amplitudes
STD_noise_with = np.std(normalized_amplitudes_max_noise_with)
STD_noise_with1 = np.std(normalized_amplitudes_max_noise_with1)
STD_noise_with10 = np.std(normalized_amplitudes_max_noise_with10)
STD_noise_without = np.std(normalized_amplitudes_max_noise_without)
# Convert the standard deviations to the number of noise photons
n_photon_noise_with = STD_noise_with * num_photons
n_photon_noise_with1 = STD_noise_with1 * num_photons
n_photon_noise_with10 = STD_noise_with10 * num_photons
n_photon_noise_without = STD_noise_without * num_photons
print('standard deviation with =', STD_noise_with)
print('standard deviation with1 =', STD_noise_with1)
print('standard deviation with10 =', STD_noise_with10)
print('standard deviation without =', STD_noise_without)
print('number of photons without cover', n_photon_noise_with)
print('number of photons without cover', n_photon_noise_with1)
print('number of photons without cover', n_photon_noise_with10)
print('number of photons with cover', n_photon_noise_without)
# Display the results
plt.figure(figsize=(10, 6))
plt.hist(normalized_amplitudes_max_noise_with, bins=37, alpha=0.7, color='lightblue', label='Normalized Maximum Noise Amplitudes (with) 37')
plt.hist(normalized_amplitudes_max_noise_with10, bins=37, alpha=0.7, label='Normalized Maximum Noise Amplitudes (with) 10')
plt.hist(normalized_amplitudes_max_noise_with1, bins=37, alpha=0.7, label='Normalized Maximum Noise Amplitudes (with) 20')
plt.hist(normalized_amplitudes_max_noise_without, bins=37, alpha=0.7, color='red', label='Normalized Maximum Noise Amplitudes (without) 37')
plt.xlabel('Amplitude (Normalized)')
plt.ylabel('Count')
plt.title('Distribution of Normalized Maximum Noise Amplitudes')
plt.legend()
plt.grid()
plt.show()
Watizi not is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.