Plot the first-order autocorrelation functions for the following light sources: perfect monochromatic source, a thermal lamp((Lc=1 μm, a led =100 μm), lasersLc=1 m and 1 km

6 Ansichten (letzte 30 Tage)
clc;
close all;
clear all;
% Parameters
tau = linspace(-10, 10, 1000); % Time delay (in arbitrary units)
omega_0 = 2*pi; % Angular frequency for monochromatic light
delta_omega_LED = 2*pi*1e6; % Linewidth for LED (assumed)
tau_c_thermal = 0.5; % Coherence time for thermal lamp (assumed)
% Autocorrelation functions
g_monochromatic = exp(1i*omega_0*tau);
g_thermal = exp(-abs(tau)/tau_c_thermal);
g_LED = exp(-abs(delta_omega_LED*tau/2)) .* exp(1i*omega_0*tau);
% Plotting
figure;
subplot(2,2,1);
plot(tau, real(g_monochromatic), 'b', 'LineWidth', 1.5);
title('Perfect Monochromatic Source');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,2);
plot(tau, real(g_thermal), 'r', 'LineWidth', 1.5);
title('Thermal Lamp');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,3);
plot(tau, real(g_LED), 'g', 'LineWidth', 1.5);
title('Light Emitting Diode (LED)');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,4);
plot(tau, abs(g_LED), 'm', 'LineWidth', 1.5);
title('Laser Source (Coherence Length 1 km)');
xlabel('\tau');
ylabel('|g^{(1)}(\tau)|');
sgtitle('First-Order Autocorrelation Functions for Different Light Sources');
I was using this code but not getting the correct graph.Using these formulae

Antworten (1)

William Rose
William Rose am 18 Feb. 2024
Bearbeitet: William Rose am 18 Feb. 2024
[Edit: fix spelling errors.]
You can format your code as code, by highlighting your code, then click the "Code" icon above. Then click the green Run arrow to run it.
clear;
% Parameters
tau = linspace(-10, 10, 1000); % Time delay (in arbitrary units)
omega_0 = 2*pi; % Angular frequency for monochromatic light
delta_omega_LED = 2*pi*1e6; % Linewidth for LED (assumed)
tau_c_thermal = 0.5; % Coherence time for thermal lamp (assumed)
% Autocorrelation functions
g_monochromatic = exp(1i*omega_0*tau);
g_thermal = exp(-abs(tau)/tau_c_thermal);
g_LED = exp(-abs(delta_omega_LED*tau/2)) .* exp(1i*omega_0*tau);
% Plotting
figure;
subplot(2,2,1);
plot(tau, real(g_monochromatic), 'b', 'LineWidth', 1.5);
title('Perfect Monochromatic Source');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,2);
plot(tau, real(g_thermal), 'r', 'LineWidth', 1.5);
title('Thermal Lamp');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,3);
plot(tau, real(g_LED), 'g', 'LineWidth', 1.5);
title('Light Emitting Diode (LED)');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,4);
plot(tau, abs(g_LED), 'm', 'LineWidth', 1.5);
title('Laser Source (Coherence Length 1 km)');
xlabel('\tau');
ylabel('|g^{(1)}(\tau)|');
sgtitle('First-Order Autocorrelation Functions for Different Light Sources');
The two formulas in the jpeg which you attached say that
  • the autocorrelation for monchromatic light is a cosine wave, and
  • the autocorrelation for a source with non-zero linewidth is a cosine wave with a Gaussian envelope.
The code does not implement the formula for non-zero linewith correctly, because it does not square the term . But that is not the reason for the zero autocorrealation in the lower panels. The reason the autocorrelation is zero in the lower panels is that delta_omega_LED is very large compared to the light frequency. In your code , the light has frequency 1 cycle per unit time. The linewidth is 2*pi*10^6 radians per unit time. Therefor, by the time tau=0.02 (the tau value closest to tau=0), , and exp(-10^4)=0, so g_LED=0, for the range of tau which you plot (except tau=0, which should=1).
Let's re-run your code, correcting the squaring issue, and changing delta_omega_LED to 0.5 instead of 2*pi*1e6.
% Parameters
tau = linspace(-10, 10, 1000); % Time delay (in arbitrary units)
omega_0 = 2*pi; % Angular frequency for monochromatic light
delta_omega_LED = 0.5; % Linewidth for LED (assumed)
tau_c_thermal = 0.5; % Coherence time for thermal lamp (assumed)
% Autocorrelation functions
g_monochromatic = exp(1i*omega_0*tau);
g_thermal = exp(-abs(tau)/tau_c_thermal);
g_LED = exp(-(delta_omega_LED*tau/2).^2) .* exp(1i*omega_0*tau);
% Plotting
figure;
subplot(2,2,1);
plot(tau, real(g_monochromatic), 'b', 'LineWidth', 1.5);
title('Perfect Monochromatic Source');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,2);
plot(tau, real(g_thermal), 'r', 'LineWidth', 1.5);
title('Thermal Lamp');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,3);
plot(tau, real(g_LED), 'g', 'LineWidth', 1.5);
title('Light Emitting Diode (LED)');
xlabel('\tau');
ylabel('Re[g^{(1)}(\tau)]');
subplot(2,2,4);
plot(tau, abs(g_LED), 'm', 'LineWidth', 1.5);
title('Laser Source (Coherence Length 1 km)');
xlabel('\tau');
ylabel('|g^{(1)}(\tau)|');
sgtitle('First-Order Autocorrelation Functions for Different Light Sources');
Therefore I think you should re-evaluate the value for delta_omega_LED. In your code comments, you say the optical frequency is in arbitrary units. But the plot title says Coherence Length=1 km, which is not an arbitrary unit. I don't know if this is relevant.
Thank you for introducing me to "sgtitle()". I didn't know about that command.
  3 Kommentare
OMEIR HUSSAIN
OMEIR HUSSAIN am 18 Feb. 2024
Thank you but they should be 5 graphs .Above you for the laser you have titled both the graphs with the same L value that is 1km.I think the graph for led is missing thank you.
William Rose
William Rose am 19 Feb. 2024
@OMEIR HUSSAIN, your script makes four plots. I shortened the titles since they were too long to fit. YOu plotted the real part at (2,2,3) and the magnitude at (2,2,4). I did not change that.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by