LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generating pwm signal ( NDB project )

hi guys,

i've been working on a project for NDB purposed. so this is basically a software project to simulate how an NDB works. image below explains how NDB system basically works.

image.png

 
so basically in this project I make an AM modulation with carrier signal in the frequency range of 195KHz - 1.8MHz and a single tone of sine wave that are only 1200Hz or 400Hz ( which will be changed into morse code next.
the result of this modulation then compared to a triangle signal wave with frequency 18x times multiplication from carrier frequency in order to get rid of noise and unwanted harmony.
This process is needed before this signal exported to power amplifier, because it is almost impossible to process directly from modulated signal without getting its PWM.
I already in the step of getting the PWM signal. but i got a problem to differentiate this pwm signal into 4 different bites, such as a a! b b! , which a! is pwm signal in the phase between 0-pi , b is in the phase of pi-2pi , a! is value 0 on pi, b! is value 0 on 0 or 2pi.
here I attach my building blocks of this project so far.
 
thank you in advance
yanra
0 Kudos
Message 1 of 10
(3,333 Views)

Hi aas,

 

but i got a problem to differentiate this pwm signal into 4 different bites, such as a a! b b! , which a! is pwm signal in the phase between 0-pi , b is in the phase of pi-2pi , a! is value 0 on pi, b! is value 0 on 0 or 2pi.

You really need to explain those "bites" and all that about 0, pi, and 2pi. What is the significance of the exclamation mark after a and b?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(3,320 Views)

@GerdW wrote:

Hi aas,

 

but i got a problem to differentiate this pwm signal into 4 different bites, such as a a! b b! , which a! is pwm signal in the phase between 0-pi , b is in the phase of pi-2pi , a! is value 0 on pi, b! is value 0 on 0 or 2pi.

You really need to explain those "bites" and all that about 0, pi, and 2pi. What is the significance of the exclamation mark after a and b?


i wanted to make the generated PWM differentiated into 4 different array
array a for all of the bit in between phase 0 and pi ( 0 - 180 )

array a! ( a not ) for all bit exactly on phase pi

array b for all the bit in between phase pi and 2pi ( 180 - 360 )

array b!( b not ) for all bit exactly phase 0 or 2pi ( 0 , 360 )IMG_20180814_131152.jpg

more or less like image above

 

thank you in advance

effen

0 Kudos
Message 3 of 10
(3,312 Views)

Hi effen,

 

how do you know just from your PWM signal which phase of the underlying sine wave corresponds to which sample in the waveform?

 

Also keep in mind: comparing float for equality is "not recommended"! Its hard enough to find the exact 0 spot, but comparing with multiples of pi might be even harder…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 10
(3,308 Views)

@GerdW wrote:

Hi effen,

 

how do you know just from your PWM signal which phase of the underlying sine wave corresponds to which sample in the waveform?

 

Also keep in mind: comparing float for equality is "not recommended"! Its hard enough to find the exact 0 spot, but comparing with multiples of pi might be even harder…


thats why im confused here, i wanted all the bit from positive value of sine wave are stored in array a and all the bit from negative value of the sine wave are stored in array b

0 Kudos
Message 5 of 10
(3,301 Views)

Hi effen,

 

so you need a subVI with two inputs: sine wave and PWM signal.

The output would be two arrays with "bits"…

 

(I still don't get the sense behind all this.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(3,296 Views)

@GerdW wrote:

Hi effen,

 

so you need a subVI with two inputs: sine wave and PWM signal.

The output would be two arrays with "bits"…

 

(I still don't get the sense behind all this.)


yeah, i need all of the generated PWM signal stored as array of bits , but differentiated into 2 different arrays as i explained before. if only stored in one array as all the pwm ( generated from positive and also negative values of sinewave ) , I already did that.

0 Kudos
Message 7 of 10
(3,292 Views)

Hi effen,

 

you could something similar to this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(3,282 Views)

@GerdW wrote:

Hi effen,

 

you could something similar to this:

check.png


hi, could you upload the labview.vi file ?

 

thank you in advance

effen

0 Kudos
Message 9 of 10
(3,272 Views)

Hi effen,

 

I didn't save that VI, I just created it from scratch in 3mins…

 

You need:

- GetWaveformTimeArray

- GetWaveformComponents

- Index&BundleClusterarray

- Threshold1DArray in a FOR loop

The other stuff should be no problem at all! (You did the basics courses offered in the training section in the header of the LabVIEW board, did you?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(3,267 Views)