How to normalize(compensate) pulse signal?
4 views (last 30 days)
Show older comments
Hi all,
I want to build up algorithm to normalize my pulse signal.
What I considered ways are:
- Find the max value from each 10 pulses
- Use the max value to calculate the ratio with each signals which lower than the max (e.g. max=1.0, so a 0.1 signal's ratio= 1.0/0.1=10)
- All of the signals will multiple to each signals speicific ratio (e.g. max=1.0, a 0.1 signal become= 0.1*10)
Ten pulses graphe
Latest max value
Here is the recent code I have right now, which can obtain the latest max value from 10 pulses
fs = 50000; % 50 kHz frequency
Ts = 1/fs*10^9; % sample rate in neno seconds
t = 1:Ts;
pulse = t<=5;
amp = [0.1, 0.3, 0.5, 0.5, 0.6, 1, 0.2, 0.8, 0.1, 0.4].';
sig = pulse.*amp;
sig = reshape(sig', [], 1);
t_total = 1:numel(sig);
max_val = zeros(size(sig)); % save maximum value at each time step;
max_val(1) = sig(1); % first maximum value is the first sample of sig
for i=2:numel(max_val)
if sig(i) > max_val(i-1)
max_val(i) = sig(i);
else
max_val(i) = max_val(i-1);
end
end
t_total = 1:numel(sig);
figure;
plot(t_total, sig);
xlabel('Time (ns)');
ylabel('Amplitude');
figure;
plot(t_total, max_val);
xlabel('Time (ns)');
ylabel('Amplitude');
0 Comments
Answers (1)
Darshan Manjunathrao Chawan
on 9 Nov 2021
In your code what is your energy of the pulse. If you know energy of the pulse then, you can use below formula
Normalpulse = sinpulse./sqrt(Energy of the pulse)
Consider for example if you have sine pulse.
0 Comments
See Also
Categories
Find more on Pulsed Waveforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!