3.0

3.0 | 2 ratings Rate this file 11 Downloads (last 30 days) File Size: 1.46 KB File ID: #9366
image thumbnail

PWM Signal from SoundCard

by

 

15 Dec 2005 (Updated )

Create a pwm signal using a standard soundcard.

| Watch this File

File Information
Description

PWM Signals are used in a wide area of applications. Examples are a servos used for positioning in electromechanical control design (mechatronic). Here is a simple function that allows to create a pwm signal with a standard soundcard. Parameters are: pulsewidth and time between pulse-starts.

One restriction is that the approach allows duty cycles up to 50% only.

All you need is to add at the output of the soundcard is a resistor as load (1k) and a diode (1N4001). The image enclosed shows the output I got for:

>> PWMSound(1.5e-3,10e-3);

Required Products Data Acquisition Toolbox
MATLAB release MATLAB 7.1.0 (R14SP3)
Other requirements standard soundcard, should work on older releases
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
16 Mar 2014 NoĆ©  
06 Aug 2008 shanthanu chakravarthy  
02 Jun 2008 oldokh tsendayush

i analsysis matlab sinmklif

19 Apr 2007 essalhi adil

pwm simulink

04 Apr 2007 Oscar Campo

You can obtain different duty cicles by adding this line after the "dat" definition:

dat=dat(1:ncycle);

Contact us