Can PWM sine pulses be generated without a lookup table?

  • A
  • Thread starter intervoxel
  • Start date
  • Tags
    Pwm Table
In summary, the conversation discusses a request for an algorithm to generate a PWM (pulse width modulation) sine wave without using a lookup table. The constraint is that the algorithm must directly produce the pulse sequence. Several suggestions are made, including using the analogWrite() function, considering Fourier construction or a digital bandpass filter. It is unclear if this is a school project or not, and the conversation is left in the General Math forum for further discussion.
  • #1
intervoxel
195
1
I need an algorithm for generating a pwm (pulse width modulation) sine, but with an important constraint: it is not allowed to use a lookup table. The pwm encoded sine pulse sequence must come directly from the algorithm itself. All attempts to find it were in vain. Can you help me? Thank you in advance.
 
Mathematics news on Phys.org
  • #2
That sounds like an odd constraint. This really is not the homework forum.

My answer is:
see if this: https://www.arduino.cc/en/Tutorial/PWM (using the analogWrite() call) is what you want. Then since this is opensource, you have a code example to work with. This particular example may not fit your needs. But this would be how I would go about finding something like this.

Since you gave zero background information about what you are doing it is really hard to make good suggestions. Sorry. Plus, I think this belongs in the Electrical Engineering Forum.
 
  • #3
intervoxel said:
I need an algorithm for generating a pwm (pulse width modulation) sine, but with an important constraint: it is not allowed to use a lookup table. The pwm encoded sine pulse sequence must come directly from the algorithm itself. All attempts to find it were in vain. Can you help me? Thank you in advance.
I agree with Jim that this is an unusual constraint. Are you our of memory, or is this an artificial constraint on a schoolwork assignment? I can move this thread to EE or to the Homework Help forums as needed.
 
  • #4
No, it is not schoolwork. I thought about the possibility of using a direct-form oscillator and somehow obtain the pulse train. But it seems to me a bit ad hoc. Perhaps a cleaner solution exists.

It is not an electric engineering project either.
 
  • #5
intervoxel said:
No, it is not schoolwork. I thought about the possibility of using a direct-form oscillator and somehow obtain the pulse train. But it seems to me a bit ad hoc. Perhaps a cleaner solution exists.

It is not an electric engineering project either.
Okay, I guess we can leave the thread in General Math for now. :smile:

Have you looked at using series or Fourier construction to make the sine wave? What other approaches have you looked at?
 
  • #6
Or you could run a square wave input through a digital bandpass filter... There would seem to be several ways to do this.
 

What is PWM without lookup table?

PWM (Pulse Width Modulation) without lookup table is a method of generating a variable pulse signal without the use of a lookup table. This means that instead of pre-calculating and storing the pulse widths in a table, the PWM signals are generated in real-time using mathematical equations.

How does PWM without lookup table work?

PWM without lookup table works by using mathematical equations to calculate the pulse width based on the desired duty cycle and frequency. This eliminates the need for a lookup table, making the process more efficient and flexible.

What are the advantages of using PWM without lookup table?

The main advantage of using PWM without lookup table is that it is more efficient and flexible compared to using a lookup table. It also allows for real-time adjustments to the pulse width, making it suitable for applications where precise control is required.

What are the limitations of PWM without lookup table?

One limitation of PWM without lookup table is that it requires more computational power compared to using a lookup table. It also may not be suitable for applications that require a wide range of duty cycles, as the mathematical equations may not be able to accurately generate all possible pulse widths.

What are some common applications of PWM without lookup table?

PWM without lookup table is commonly used in applications where precise control of pulse width is required, such as motor control, LED dimming, and power converters. It is also used in microcontrollers and digital signal processors for generating PWM signals.

Similar threads

  • Electrical Engineering
Replies
21
Views
1K
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Sci-Fi Writing and World Building
Replies
4
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
Replies
4
Views
2K
  • Advanced Physics Homework Help
Replies
6
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Introductory Physics Homework Help
Replies
12
Views
3K
Replies
2
Views
2K
Back
Top