Home › Forums › SYSTEM › How to get Output from Optical Power Meter Component? › Reply To: How to get Output from Optical Power Meter Component?
Hello 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.
Categories
- All
-
Knowledge
Contains a detailed Q&A knowledge base. -
General
All non-technical questions. -
System
Optical system design and analysis. -
Instrument
Communicate and control different kinds of instruments. -
SPICE
Opto-electronic circuit design. -
FDTD
Finite-Difference Time-Domain simulation. -
BPM
Beam Propagation Method analysis and design. -
Grating
Fiber optic grating simulation. -
Fiber
Optical fiber design and characterization. -
Exchange
Users can exchange design files.
(Matlab, C++, etc.)