enter image description here There is a signal that contains:

  • Rectangular pulses on frequency of 1 kHz
  • Rectangular pulses on frequency of 1.4 kHz
  • Other noises.


  • Separate 1kHz pulses from everything else and measure their amplitude and duration
  • Separate 1.4kHz pulses from everything else and measure their amplitude and duration

Was tried:

  • Use a positive IIR filter of the 6th order (at a frequency of 1kHz and at a frequency of 1.4kHz). After the filter, information about the initial amplitude and duration was completely lost.
  • Use comb filter. The output signal is smeared due to the mismatch of the input signal period and the filter period.
  • Searching and asking a question in my native language (Russian) did not help. I did not find any examples. The only possible solution proposed was the use of correlation analysis. But I could not work out, how to use it for solving my problem, again there was not a single explanation or example.

P.S. I’ve already asked this question, but maybe I wrote something that is not clear (I am not a native speaker of English), please ask, I will try to explain more clearly. I have one last hope on the international site that someone has faced this problem and will be able to share a solution or explain how to solve it. Thank you very much in advance!


why do you want to filter? your signals look clean

In that question, the picture was just for example. In this question, the picture looks like my real signal.

Yeah, classical XY problem: You're asking a strange question (you want to filter, but you want to have none of the effects of filtering?) without telling us why you want to do it, for what purpose, in what greater context.

In this thread, I tried to describe in more detail what I want.

If I understand correctly and you want a system that picks some pulses and rejects others based on their fundamental period: a filter is not going to do it, at least not by itself.

I need to separate the 1 kHz pulses from everything else and measure their amplitude and duration, and then separate the 1.4 kHz pulses from everything else and measure their amplitude and duration.

Does the amplitude stay constant for the duration of the pulse groups? Do you have a subset of possible pulse groups: number of pulses at the 1.4 KHz rate, number of pulses at the 1KHz rate? Please provide all info in terms of what these pulses are doing and why you are doing this may also help answer those questions you may not be sure how to ask. The sentence "at certain points in time it can change by 200 us..." was particularly confusing- what is "It", the duration? What does it mean for the duration to change by 200 us, increase to 300 us?

No, the amplitude can vary. I tried to describe everything in more detail in this topic.

Do the pulses add (i.e., if a 1.4kHz pulse and a 1kHz pulse land on top of each other is the result the sum of the pulse heights)? Do you have to catch each and every pulse, or can you miss some?

Yes, when they fall on each other it will be the sum of the heights. The signal above shows this. In the ideal case, I would like to catch every impulse, but in fact you can also skip.

  • 1
    $\begingroup$ "P.S. I’ve already asked this question" yes. And you were asked for clarification, and as far as I can tell did not respond (when you respond to a specific person say, e.g. "@timwescott" and they'll get pinged). So did you delete the other questions that had our questions to you? I just searched for it and did not find it. So my question to you is how do you expect your question to be answered when experts on the group ask you for the information they need so that they can undertake to answer on their own donated time your question? $\endgroup$
    – TimWescott
    Dec 22, 2019 at 0:03
  • $\begingroup$ "@TimWescott" In the question, the name, which “Digital filter that does not distort a square wave” I can not leave a comment for some reason. I get a message: "You must have 50 reputation to comment." This is the same user profile, I don’t know why this happens, but I can’t leave a comment there on that question. Sorry… I did not delete the previous question, I also can not delete it. I don’t know why this is happening. I will gladly provide any necessary information, but in that question, as I wrote earlier, I can’t edit it and leave comments ... Some error occurred, as I believe ... $\endgroup$
    – red15530
    Dec 22, 2019 at 8:18
  • $\begingroup$ @TimWescott Tell me how can I delete old questions or make one of all the questions. I just don’t know how to do it. Sorry, I'm a newbie ... $\endgroup$
    – red15530
    Dec 22, 2019 at 8:30
  • $\begingroup$ @jaket I cant leave messages in "Digital filter that does not distort a square wave" topic, I have not enough reputation I guess... So edited this thread "Separation of signals without loss of information about the signals themselves" and ANSWERED ALL YOUR QUESTIONS ABOVE! Still need your help! $\endgroup$
    – red15530
    Dec 22, 2019 at 9:38
  • $\begingroup$ @Marcus Müller I cant leave messages in "Digital filter that does not distort a square wave" topic, I have not enough reputation I guess... So I ANSWERED ALL YOUR QUESTIONS ABOVE! $\endgroup$
    – red15530
    Dec 22, 2019 at 9:39

1 Answer 1


This is probably going to take multiple steps. As a start, here is what I'd do:

  • You want a filter that retains pulse information, but filters noise. The most extreme you can do with this is a rectangular filter that's $100\mu\mathrm{s}$ long, or possibly a raised-cosine filter that's about the same length.
  • Assuming that the pulse timing is very consistent, phase lock to each pulse train. This means you have one 1kHz PLL, and one 1.4kHz PLL. When you get ready for this step you may want to ask a separate question, but if your pulses always start with the same timing (i.e., if a "long" pulse just ends $100\mu\mathrm{s}$ later than "normal") then you can lock onto the leading edge of each pulse.
  • Any time the PLL phases indicate a pulse will overlap, ignore both -- basically, output "null" on both channels. You probably need to allow room for those $200\mu\mathrm{s}$ pulses you speak of.
  • Detect long pulses by looking for unexpected energy $100\mu\mathrm{s}$ later than the expected center of the filter output.
  • Detect pulse height by looking at the height of the filtered pulse where the PLL tells you.

The very beginning part of development for this would be to record your data into a file so you can play with it, run it through your best guess at a matched filter, and look at it.

  • $\begingroup$ I understand correctly: First I need to pass the signal through a rectangular filter or raised-cosine filter. Next, do you need to implement something like a software PLL, one for each frequency? $\endgroup$
    – red15530
    Dec 23, 2019 at 8:10
  • $\begingroup$ I have little experience in this topic. Can I have an example? $\endgroup$
    – red15530
    Dec 23, 2019 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.