Can PWM sine pulses be generated without a lookup table?

  • Context: Graduate 
  • Thread starter Thread starter intervoxel
  • Start date Start date
  • Tags Tags
    Pwm Table
Click For Summary

Discussion Overview

The discussion revolves around generating a PWM (pulse width modulation) sine wave without utilizing a lookup table. Participants explore various algorithmic approaches and constraints related to this task, touching on theoretical and practical aspects of signal generation.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant requests an algorithm for generating a PWM sine wave, emphasizing the constraint of not using a lookup table.
  • Another participant questions the constraint, suggesting that it may not be suitable for the forum and refers to an Arduino tutorial as a potential resource.
  • A third participant echoes the unusual nature of the constraint and inquires about the context, wondering if it stems from memory limitations or an assignment.
  • A participant proposes the idea of using a direct-form oscillator to generate the pulse train but expresses concern that this approach may be too ad hoc.
  • Another suggestion involves using series or Fourier construction to create the sine wave, indicating a potential method for achieving the desired PWM signal.
  • One participant suggests running a square wave input through a digital bandpass filter as an alternative method for generating the sine wave.

Areas of Agreement / Disagreement

Participants generally agree that the constraint of not using a lookup table is unusual, but there is no consensus on the best approach to generate the PWM sine wave. Multiple competing views and methods are presented without resolution.

Contextual Notes

Participants express uncertainty regarding the rationale behind the constraint and the specific context of the request, which may affect the suggestions made. There is also a lack of detailed background information provided by the original poster.

intervoxel
Messages
192
Reaction score
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
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.
 
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.
 
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.
 
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?
 
Or you could run a square wave input through a digital bandpass filter... There would seem to be several ways to do this.
 

Similar threads

  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
11K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
9
Views
4K