PROTEUS-SIM / PROTEUS

MIT License
10 stars 0 forks source link

Load negative waveform in TransmitGUI #3

Open FleurVialle opened 2 months ago

FleurVialle commented 2 months ago

If I upload a negative impulse response waveform with an amplitude of 1 into the TransmitGUI, the voltage amplitude gives 0. If I want to change the amplitude to for example 10, the voltage signal becomes Nan and the mechanical index becomes Inf. To fix it, I changed line 22 in the function get_voltage_signal.m from Transmit.VoltageSignal = V(Transmit.VoltageAmplitude/max(V)); to Transmit.VoltageSignal = V(Transmit.VoltageAmplitude/max(abs(V))); and in TransmitGUI.LoadWaveformButton I replaced line 479: app.Transmit.VoltaeAmplitude = max(CustomSignal.V) by app.Transmit.VoltaeAmplitude = max(abs(CustomSignal.V)).

NathanBlanken commented 2 months ago

Hi Fleur, thanks for your feedback! I will implement your solution during the next code revision.