spaghetti_developer Posted May 7, 2010 Report Share Posted May 7, 2010 Hi to ALL, How can I determine a shape of a waveform? You know the waveforms could have different shapes, I mean sine, triangle, swatooth and so on. I know the input waveform and I want to build a function that return the shape (as a string or enum data) of the input waveform. How can I do that? Quote Link to comment
GoGators Posted May 10, 2010 Report Share Posted May 10, 2010 Hi to ALL, How can I determine a shape of a waveform? You know the waveforms could have different shapes, I mean sine, triangle, swatooth and so on. I know the input waveform and I want to build a function that return the shape (as a string or enum data) of the input waveform. How can I do that? Take the FFT of the signal. It works out best if you take full periods rather than fractional periods. Then looking at the magnitude of the FFT, you can decipher what it is. Typically with some sort basic algorithm. A sine will have a single tone, a square will look like the sinc(x) funtion, etc. Another option is a "matched" filter. Essentially make a filter that will cancel out the all signals except the one you are trying to detect. Typically this is done by finding the impulse response for each of your signals, then convolving them through one by one till you find your match. These work well if you know ahead of time what you are expecting. Good luck. Quote Link to comment
Seraph Posted May 12, 2010 Report Share Posted May 12, 2010 (edited) I think his mean is how to display the name of the known input waveform, i.e, if the input waveform is a triangle, then there is a string(or enum) of "triangle" should be displayed on diaplay indicator. If so, maybe you'll have to know first the unique features for each waveform and then distinguish them by these features. Oh, Sorry, I didn't read GoGators's reply carefully , GoGators has given a solution to this problem. so please ignore this post. Edited May 12, 2010 by Seraph Quote Link to comment
spaghetti_developer Posted May 20, 2010 Author Report Share Posted May 20, 2010 Thank you to all for your replies. I resolved the problem inserting in the NI_ChannelName attribute the name of the waveform I had built with a specific function. I'm showing the NI_ChannelName that contain the name of the waveform shape into a string indicator on the FP. It works good. Thanks again for your replies. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.