- This topic has 2 replies, 2 voices, and was last updated 15 minutes ago by
Dhruv D.
-
AuthorPosts
-
-
February 3, 2025 at 10:53 am #89081
Dhruv D
ParticipantHi I am using Optisystem Version 20, I am working with the FSO channel component in Optisystem and my Schematic is like this
Optical Transmitter (1550nm) —————> FSO Channel —————- Optical Receiver. I want to measure the (1) Optical Power after the FSO Channel and (2) use that value for calculations in Matlab from matlab component (MATLAB Co-Simulation). For the (1) I used the “Optical Power Meter” component, but for (2) I am unable to get the Power Meter’s Value as an output for MATLAB Component, because Power meter doesn’t have an output Port. Also, when I use MATLAB Component with the FSO Channel I receive a struct data in MATLAB workspace which only containsInputPort1.TypeSignal: ‘Optical’
InputPort1.Sampled: 1X1 struct
InputPort1.Parameterized: []
InputPort1.Noise: 1X1 Struct
InputPort1.IndividualSample: []
InputPort1.Channels: 1.9341e+14Where “Sampled” contains signal values with respect to time and value of central frequency, and “Noise” contains Noise Power, Lower Frequency, Upper Frequency and Phase. The struct doesn’t contains the Power Value. Please, suggest me a method how can I get the total optical power value and send it to MATLAB through MATLAB component in Optisystem.
Thank you for your kind help.
-
February 4, 2025 at 4:30 pm #89096
Saurabh Bedi
ModeratorHello Dhruv,
Thanks for reaching out to us.
Your professor Hemani Kaushal reached out to our team as well with the same query.
From your query, what I understand is that you need to calculate the total power of the signal entering the matlab component. Later you need this total power for further processing in your matlab code.
Please note that there is no direct method of extracting power from the input signal defined in the matlab code. Instead you will have to write a small piece of code to extract the total power of the input signal.
Below is the small piece of code you can write to extract power from the signal:-%%%%%%%%%%%%%% Total Power Calculation %%%%%%%%%%%%%%%%
real_signal_data = real(InputPort1.Sampled.Signal);
imag_signal_data = imag(InputPort1.Sampled.Signal);
magnitude_signal = sqrt(real_signal_data.^2 + imag_signal_data.^2);
power_abs = abs(magnitude_signal).^2;
time_data = InputPort1.Sampled.Time;
delta_t = time_data(2) – time_data(1); % Time Step
T = time_data(end) – time_data(1); % Total sample time
power_dt = (power_abs .* delta_t);
power_dt_sum = sum(power_dt);
total_power = power_dt_sum / T; % Total Power (in Watt)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%You can use this code and check the ‘total_power’ in the workspace. For a sanity check, you can connect the ‘Optical Power Meter’ to the splitter before it enters the matlab component, to visualize the power entering into the matlab component. The power shown in the power meter should match the ‘total_power’ calculated in the matlab code. You can vary the power in the laser and test it.
I hope this helps?
Warm Regards,
Saurabh Bedi. -
February 5, 2025 at 11:09 am #89100
Dhruv D
ParticipantThank You very much Sir, for your help. The code is working. Thank You very much sir.
-
-
AuthorPosts
- You must be logged in to reply to this topic.