How to separate noise and signal in a histogram

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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>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()
</code>
<code>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() </code>
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()

New contributor

Watizi not is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật