![]() However, I'm having that feeling that I'm reinventing something so feel free to look up for some literature about this method, I'm sure someone did the math to obtain optimal values of windowslength and trigger. Set trigger between the RMS crests and the noise.In my case it was approximately 1 % of the total number of samples. Set windowlength to get the RMS signal mean value far enough of the noise while keeping accuracy.Then I set trigger = 0.4 and obtained two crystal clear zones identifying the useful signal : Here is the signal (blue), and the calculated RMS signal (red) for windowlength = 8191 : Note that I had to take Fs = 10^5 because my computer does not have enough capacity for Fs = 10^6. If this calculated value is significant enough to be considered as "not noise", we assign '1' to it. What we are doing here, in simple language, is taking little bits of the signal and calculating the RMS value of each bit. Then you set a minimum value for which superior values of the RMS signal will be assigned to 1, and the other to zero : trigger = 0.5 %I chose arbitrarily Sig_RMS(i-hw) = sqrt(mean(sig_zero_padded(i-hw:i+hw))) % calculating square-mean inside the window and assigning the result Sig_zero_padded = sig_zero_padded.^2 %squaring the samplesįor i=(hw+1):(length(sig_zero_padded)-hw) ![]() %I'm adding zeros the the signal's left and right for boundary calculation The generated square wave has a value of 1 for intervals n, ( n + 1) ) with even n and a value of - 1 for intervals n, ( n + 1) ) with odd n. t linspace (0,3pi) x square (t) Plot the square wave and overlay a sine. Hw = (windowlength-1)/2 %hw stands for "half window" Generate a square wave with a period of 2. What you can do is process this signal with a windowed RMS function (I'm writing in matlab code, but it can easily be translated in python) : windowlength = 5 %you can change that, but keep it odd If there is any other method to calculate the duration of each pulse in the sequence, I'm open to all ideas. What kind of filter do I need to convert the signal to square signal? Is it possible?įor information, I'm using Python and Numpy.Do I need a low pass filter to remove the noise?.I apply a magic filter to convert the signal to square signal.To have the signal between 0 and the amplitude, I multiply the signal by itself.Remove the noise => Low pass filter I presume?.I'm not sure of the different steps needed for this conversion but I have some leads: To do that, I was thinking of converting this signal to a square wave signal like this: I'd like to calculate each pulse duration. In its current form each pulse duration is the same, but it's not always the case. I have a signal containing a variation of digital ASK type on-off keyed sine wave among which some stochastic irrelevant harmonic waves occur, like you can see on this figure:
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |