How to generate data to follow a sinusoidal trend


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116

    Question How to generate data to follow a sinusoidal trend

    Hi All,

    I want to make a Tide simulator which will periodically send serial data, not hard at all.

    The problem is I want the sent values to follow the natural sine curve of tides. I can add the bells and whistles later e.g. the double hump per day, springs and neaps, minimum and maximum values, etc, etc,... but I have no idea what weight or how to apply these values to the data for the sine curve.

    Does anyone have some thoughts on how to do this?

    Thanks and regards,
    Bill

  2. #2
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: How to generate data to follow a sinusoidal trend

    I went here http://en.wikipedia.org/wiki/Tide and found more info than I knew existed about tides and tide data.

  3. #3
    Join Date
    Oct 2005
    Location
    Pinckney, Michigan
    Posts
    91


    Did you find this post helpful? Yes | No

    Default Re: How to generate data to follow a sinusoidal trend

    I used a DAC (digital to analog converter) formed with an R2R ladder on a PIC port, to generate a near perfect sine wave.

    Generate the values you need with a spreadsheet using the Excel SIN function, put them in a software table, then periodically go get the values from the table one at a time, and write them to the port, with appropriate delays between writes.

    You might add a capacitor to the output of the ladder for smoothing.
    Last edited by J. Mark Wolf; - 18th December 2012 at 12:41.

  4. #4
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116


    Did you find this post helpful? Yes | No

    Default Re: How to generate data to follow a sinusoidal trend

    Thanks J. I'm not interested in the analog voltages only sending serial values - but the Excel idea is a good one. I'm no guru with Excel but will learn from this and give it a go.

    Regards,
    Bill

Similar Threads

  1. how can i follow the execution of my program?
    By reda89 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 22nd August 2012, 15:09
  2. sinusoidal PWM
    By bwaxing in forum mel PIC BASIC Pro
    Replies: 83
    Last Post: - 25th February 2012, 18:33
  3. sinusoidal pwm
    By bwaxing in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st May 2011, 15:00
  4. Displaying Trend Information
    By Mike M. in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd November 2005, 03:21
  5. Follow-on To Caps-lock Post
    By languer in forum General
    Replies: 2
    Last Post: - 2nd March 2004, 08:52

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts