×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Python code

Python code

Python code

(OP)
Hi guys,

Does anyone have Python code for calculating vibration magnitude and phase shift using a PC sound card?

thanks

Mark.

RE: Python code

no, but a rapid google led me to numpy

import audiolab, scipy
x, fs, nbits = audiolab.wavread(filename)
X = scipy.fft(x)

If you want the magnitude response:

import pylab
Xdb = 20*scipy.log10(scipy.absolute(X))
f = scipy.linspace(0, fs, len(Xdb))
pylab.plot(f, Xdb)
pylab.show()

which all seems jolly relevant to me

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

RE: Python code

(OP)
I found that using FFT was quite slow and the results seemed to jump around a lot. My simple approach is to filter the imbalance signal and measure the difference at the zero crossings.

RE: Python code

Time domain filtering has rather lost in popularity to an FFT approach, but if you are after a specific result it is often faster.

For example, real time fast slew rate antinoise systems use time signal filtering, they don't bother with frequency domain.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

RE: Python code

(OP)
Hey guys,

managed to get a simple program to detect phase shift using zero crossings. however I just discovered there is another method called the "wattmeter method". It is more robust from what I understand. Does anyone know how it works and how I could apply it to software code?

thanks

mark.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources