This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

pi/2 lag signal generation

Other Parts Discussed in Thread: TMS320F28335, CONTROLSUITE

Hi all!

I'm working on TMS320F28335 DSP. I want to generate a 90degree lag signal for a sine wave (It may contain some harmonics also). frequency may vary in the range 49-51 Hz. Plz provide me a solution on how to generate 90 degree lag signal.

regards,

Mahesh

  • Hi Mahesh!

    I would recommend you to refer to SGEN library: ti\controlSUITE\libs\dsp\SGEN\v101\

    Regards,

    Igor

  • Hi Igor!

    The library you mentioned have only sine wave generators. I need a pi/2 lag signal of my input sine wave(not pure). Can you please suggest me something which will work in my case.

    regards,

    Mahesh

  • Hi Manesh!

    Anyway you need to define the period before making the shift. If you do not know the signal's frequency then the notion of "a shift of 90 degrees" is undefined. In my opinion in general your algorithm might be following:

    Input Signal> ADC > Determining the period T of waveform (for example through the method of "the zero crossing") > Shift T/4 > DAC> Output Signal.

    Regards,

    Igor

  • Can achieve the phase shift just by storing 1/4 of the samples and use the oldest one. Say sampling rate is 200/ cycle, means at every 20ms/200 = 100us (10KHz) for a 50Hz case. 
    Allocate a buffer of 50 size, keep on storing the values (pointer 0-49), use the oldest one before over writing it as the phase shifted signal. For best results vary the sampling time to get always 200 samples per cycle.
      
    Hope it is clear