Digital filtering based on frequency component amplitude... why not? I've got a very general question.
I've just implemented a filter working in frequency domain that simply cuts every frequency component whose modulus amplitude falls below a certain threshold value. As to say, "just keep the main frequencies in the signal". See example below:

Here is the effect in time domain on a noisy square wave:

It could seem to have poor performance in time domain, but this 'frequency picking' worked perfectly for my particular problem.
However, it seems to me that this is not so usual in DSP, and, since I'm not a DSP expert (I'm a physicist and not an electronic engineer), I wonder if this kind of approach (i.e. select the frequencies to keep based on their amplitude in the transformed domain and discard all the rest) is a known method in literature and, if it's so, what's its name. Or, on the contrary, I would be curious to know if there are some general reasons to avoid such a criterion.
I found no reference on the web...

Thanks!

Federico
I can tell you why I avoid such methods. When you pick some frequencies above threshold and remove others, you are using a kind of hard limit. In DSP this is same as Rectangular Windowing in frequency domain. It's effect in time domain will cause ringing. Because when you multiple in frequency domain with rectangular window, in time domain the signal gets convolved with a sinc function. There is a whole wikipedia page dedicated to this (Gibbs Phenomenon) - https://en.wikipedia.org/wiki/Gibbs_phenomenon

Again it depends on our requirements though. For example, if you see your filtered signal, the rise and fall time are not steep compared to original signal because you have eliminated higher frequencies which contribute to this. If my requirement was to apply a filter without compromising on fast rise time, I would not choose this method.