Graduate Can PWM sine pulses be generated without a lookup table?

  • Thread starter Thread starter intervoxel
  • Start date Start date
  • Tags Tags
    Pwm Table
Click For Summary
Generating a PWM sine wave without a lookup table poses a challenge, as the requestor seeks an algorithmic solution. Suggestions include exploring direct-form oscillators and series or Fourier construction methods to create the sine wave. The conversation highlights the difficulty of providing tailored advice due to a lack of background information on the project. Alternative methods, such as using a square wave input through a digital bandpass filter, are also mentioned. The discussion remains focused on finding a clean and efficient algorithmic approach to meet the specified constraints.
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.
 
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · 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 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
771