I already asked a similar question, but did not receive an answer and did not find a solution, I want to make another attempt to get to the bottom of the truth.
There is a signal consisting of rectangular pulses at different frequencies and other noises. The amplitude of the rectangular pulses may vary. The duration of the pulses can be either 100 μs, or vary by 150-200 pulses per 200 μs.
This is a real signal, which consists of pulses at a frequency of 1 kHz, pulses at a frequency of 1.4 kHz and other noises.
How can one distinguish the amplitude of these pulses and find out the duration? If more details, I need to find:
- The amplitude of the pulses is 1 kHz. (the pulses themselves are not important, I just need the average amplitude of each pulse)
- The pulse amplitude of 1.4 kHz. (the pulses themselves are not important, I just need the average amplitude of each pulse)
- The duration of 1 kHz impulses (the exact time is not required, I just need “yes” if the duration is 100 µs, “no” if the duration is 200 µs.)
- The duration of 1.4 kHz impulses (the exact time is not needed, I need “yes” if the duration is 100 µs, “no” if the duration is 200 µs.)
I thought that you can use two band IIR filters, for example 6 orders of magnitude at a frequency of 1 kHz and a frequency of 1.4 kHz, respectively. But after the filter, the amplitude and duration of the initial rectangular signal are lost, and I cannot calculate the initial amplitude and duration of the pulses.
I saw a device that somehow solves this problem on a simple microcontroller, when applying such a signal to the input, at the output I see the amplitudes of both signals, so I concluded that somehow it can be done programmatically. For a month I have been trying to find a solution to this problem on the Internet in both my native language and internationally, but my searches have come to nothing. Perhaps someone solved a similar problem and simply did not share the solution, or no one came across a similar task ... I re-read a lot of pages of “stackexchange” in search of a solution to the problem, but I couldn’t find the answer. I will be glad of any help in solving this problem!
Here is an attempt to simulate this signal in a matlab:
Fs = 100000;
t = 0:1/Fs:0.01;
F = 1.5;
f0 = 1000;
tau = 0.0001;
s = (square(2*pi*t*f0, f0*tau*100) + 1)* F/2;
s = s+randn(size(t))/50;
F2 = 2;
f02 = 1400;
tau2 = 0.0001;
s2 = (square(2*pi*t*f02, f02*tau2*100) + 1)* F2/2;
s2 = s2+randn(size(t))/50;
a=s+s2;
Next, I created mask “b” and tried to use circular cross correlation for verification:
b=0;
for i=1:10
b(i)=1;
end
for i=11:100
b(i)=0;
end
b=[b,b,b,b,b];
xcorr = fft(a).*conj(fft(b,length(a)));
At the output, I got this picture.
Here is the result of circular cross correlation with no bias of the original signal, with bias of 30:
Next, on the threshold, I find the beginning of the impulse, and did the integration over 100 μs and a dump:
temp=0;
i=1;
corrf=[];
for g=1:1000
if (corr(g)>42) || (temp==1)
temp=1;
corrf(i)=corr(g);
i=i+1;
end
end
corrf=corrf(1:900);
intdump(corrf,10);