01-20-2017 06:23 AM
Dear Friends,
How can be polarity of a signal determined?
Thank you.
01-20-2017 06:55 AM
Polarity can be many things so you'll have to be a little more specific with your question.
Example of 'inversed polarity' or 'negative polarity'
- The two wires connecting a loudspeaker may have been swapped so the acoustic response to a positive impulse is negative (the membrane is moving backward)
- An active filter may use inverting op-amp configuration
So often you can detect whether the polarity of a system (not a signal) in inverted (negative) by applying a positive impulse to that system and look at the polarity of the response.
What's your use case?
01-20-2017 08:33 AM
01-20-2017 08:41 AM
Yeah but it returns -1, 0 or +1 so how do you determine the polarity of its output?
01-20-2017 08:54 AM
@LocalDSP wrote:
Yeah but it returns -1, 0 or +1 so how do you determine the polarity of its output?
By reading the help file? 😉
01-20-2017 11:51 AM
@1085 wrote:
Dear Friends,
How can be polarity of a signal determined?
Thank you.
Polarity in respect to what?
01-20-2017 12:03 PM
Thank you for your reply. How do I determine that signal is bipolar by using the sign function if the signal is bipolar?
Sincerely,
1085
01-20-2017 12:15 PM - edited 01-20-2017 12:17 PM
The signal has to basically be an array (otherwise it is just a number and it will be either +, -, or zero). So among that array of numbers, you need to determine if some are positive and if some are negative. I would use Array Max/Min. Divide the Max by the Min. If the resulting ratio is positive, then you know the signal is not bipolar, i.e. both the max and min are on the same side of zero. If the resulting ratio is negative, then you know it must be bipolar. Max is positive, the min is negative.
You could use the sign function acting on the array, then your results would be an array of +1's, 0's, and -1's. You could do max and min on that. But that is just another conversion step.