Jump to content

Pulse Width Modulation to transmit FM radio waves? (make my own mini radio station?)

babadoctor
Go to solution Solved by babadoctor,

So to finish this thread, it is completely possible (AND HAS BEEN DONE) after a lot of research i found this application.

 

https://bk.gnarf.org/creativity/vgasig/

 

It works.

 

 

Thanks!

I want to program an application that allows me to do PWM on my computer and transmit FM radio signals using this method. 

 

I know a program already exists that allows me to do this with a GPIO pin on the raspberry pi, but I want to do this on my pc/laptop, possibly with one of the USB pins on my computer?

 

It would only generate a signal within the mhz frequencies, such as 100.1Mhz

 

https://github.com/Miegl/PiFmAdv

 

This is the raspberry pi program which works

 

Is anyone here knowledgeable in this concept?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

You can't use one modulation type to directly create another modulation type signal. Modulation in simple terms is converting the digital signal into an analog signal. There must be an intermediary modem to convert the digital PWM signal into the analog FM signal.  

 

Specifically PWM works by changing the duty cycle of a sine wave and is independent of signal frequency. FM obviously works by changing the frequency of the signal.

[Out-of-date] Want to learn how to make your own custom Windows 10 image?

 

Desktop: AMD R9 3900X | ASUS ROG Strix X570-F | Radeon RX 5700 XT | EVGA GTX 1080 SC | 32GB Trident Z Neo 3600MHz | 1TB 970 EVO | 256GB 840 EVO | 960GB Corsair Force LE | EVGA G2 850W | Phanteks P400S

Laptop: Intel M-5Y10c | Intel HD Graphics | 8GB RAM | 250GB Micron SSD | Asus UX305FA

Server 01: Intel Xeon D 1541 | ASRock Rack D1541D4I-2L2T | 32GB Hynix ECC DDR4 | 4x8TB Western Digital HDDs | 32TB Raw 16TB Usable

Server 02: Intel i7 7700K | Gigabye Z170N Gaming5 | 16GB Trident Z 3200MHz

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, DeadEyePsycho said:

You can't use one modulation type to directly create another modulation type signal. Modulation in simple terms is converting the digital signal into an analog signal. There must be an intermediary modem to convert the digital PWM signal into the analog FM signal.  

 

Specifically PWM works by changing the duty cycle of a sine wave and is independent of signal frequency. FM obviously works by changing the frequency of the signal.

Well, then how come I could broadcast FM signals from my raspberry pi's GPIO pin?

 

I didn't have any intermediary modem at all.

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, babadoctor said:

Well, then how come I could broadcast FM signals from my raspberry pi's GPIO pin?

 

I didn't have any intermediary modem at all.

That's BECAUSE they are GPIO pins that happen to have the capability to be used for frequency modulation. USB or any other standardized digital port wouldn't have that capability.

[Out-of-date] Want to learn how to make your own custom Windows 10 image?

 

Desktop: AMD R9 3900X | ASUS ROG Strix X570-F | Radeon RX 5700 XT | EVGA GTX 1080 SC | 32GB Trident Z Neo 3600MHz | 1TB 970 EVO | 256GB 840 EVO | 960GB Corsair Force LE | EVGA G2 850W | Phanteks P400S

Laptop: Intel M-5Y10c | Intel HD Graphics | 8GB RAM | 250GB Micron SSD | Asus UX305FA

Server 01: Intel Xeon D 1541 | ASRock Rack D1541D4I-2L2T | 32GB Hynix ECC DDR4 | 4x8TB Western Digital HDDs | 32TB Raw 16TB Usable

Server 02: Intel i7 7700K | Gigabye Z170N Gaming5 | 16GB Trident Z 3200MHz

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, DeadEyePsycho said:

That's BECAUSE they are GPIO pins that happen to have the capability to be used for frequency modulation. USB or any other standardized digital port wouldn't have that capability.

Can a serial pin be used for frequency modulation?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

No because with serial communication there is an agreed upon baud rate for the duration of a transmission. In other words you would never be able to modulate it so the frequency changes according the data being broadcast

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, trag1c said:

No because with serial communication there is an agreed upon baud rate for the duration of a transmission. In other words you would never be able to modulate it so the frequency changes according the data being broadcast

what do you mean by that, can't i set the "agreed upon baud rate" to something like 100 million pulses and the duration of the transmission be one second?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

You can but that doesn't modulate the data to a FM signal. Your receiving device would have no idea what to do with the data because both devices need an agreed upon rate. The receiver would need to know the data before hand in order to decode it. But that still doesn't change the fact that it's still a serial data set that is not frequency modulated. It only changes the speed at which bits are sent.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, trag1c said:

You can but that doesn't modulate the data to a FM signal. Your receiving device would have no idea what to do with the data because both devices need an agreed upon rate. The receiver would need to know the data before hand in order to decode it. But that still doesn't change the fact that it's still a serial data set that is not frequency modulated. It only changes the speed at which bits are sent.

"Your receiving device would have no idea what to do with the data because both devices need an agreed upon rate"

Is there some sort of handshake between the receiver and the broadcaster, in which they agree upon a rate?

 

So I can't just set the rate as the agreed upon rate?

 

I obviously have some really flawed understanding of FM modulation

 

"The receiver would need to know the data before hand in order to decode it."

"But that still doesn't change the fact that it's still a serial data set that is not frequency modulated. It only changes the speed at which bits are sent."

 

If this is pertaining to the thing I said about a serial port, I only said this as an example, it could be any port.

 

 

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, babadoctor said:

"Your receiving device would have no idea what to do with the data because both devices need an agreed upon rate"

Is there some sort of handshake between the receiver and the broadcaster, in which they agree upon a rate?

 

So I can't just set the rate as the agreed upon rate?

 

I obviously have some really flawed understanding of FM modulation

 

"The receiver would need to know the data before hand in order to decode it."

"But that still doesn't change the fact that it's still a serial data set that is not frequency modulated. It only changes the speed at which bits are sent."

 

If this is pertaining to the thing I said about a serial port, I only said this as an example, it could be any port.

 

 

Baud is the symbols per second the signal sends. Symbols have their own predefined electrical characteristics set by the standard for the serial port.

[Out-of-date] Want to learn how to make your own custom Windows 10 image?

 

Desktop: AMD R9 3900X | ASUS ROG Strix X570-F | Radeon RX 5700 XT | EVGA GTX 1080 SC | 32GB Trident Z Neo 3600MHz | 1TB 970 EVO | 256GB 840 EVO | 960GB Corsair Force LE | EVGA G2 850W | Phanteks P400S

Laptop: Intel M-5Y10c | Intel HD Graphics | 8GB RAM | 250GB Micron SSD | Asus UX305FA

Server 01: Intel Xeon D 1541 | ASRock Rack D1541D4I-2L2T | 32GB Hynix ECC DDR4 | 4x8TB Western Digital HDDs | 32TB Raw 16TB Usable

Server 02: Intel i7 7700K | Gigabye Z170N Gaming5 | 16GB Trident Z 3200MHz

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, DeadEyePsycho said:

Baud is the symbols per second the signal sends. Symbols have their own predefined electrical characteristics set by the standard for the serial port.

Okay, i see

I thought that the PWM modulation worked by sending a signal through a piece of metal so rapidly that it created a 100mhz signal.


I guess there is a lot more to it than just that.

 

"You can't use one modulation type to directly create another modulation type signal."

could you please explain to me how the raspberry pi's gpio pin is different than an analog pin on a pc?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

47 minutes ago, DeadEyePsycho said:

Specifically PWM works by changing the duty cycle of a sine wave and is independent of signal frequency. FM obviously works by changing the frequency of the signal.

Square wave, and it would be possible to convert from one to the other by specifying that the frequency is defined as, say "the duty cycle, adjusted to fit into the output band". Be aware that this method requires special external hardware.

 

18 minutes ago, babadoctor said:

"Your receiving device would have no idea what to do with the data because both devices need an agreed upon rate"

Is there some sort of handshake between the receiver and the broadcaster, in which they agree upon a rate?


The real problem here is that there are both negative and positive parts of the wave. But this can be solved crappily by saying that the actual frequency of the FM wave is double that of the duty cycle (or half that, if you prefer).

As for the rest of the problem, I suppose it's possible to finagle PWM into USB, by outputting the current duty cycle as a number. You know, using USB like it was meant to be used?

The biggest problem here is that all of these methods require external hardware, although if the implementer is smart enough, I suppose he could make a PCIe PWM generator that would make the whole thing simpler. But I imagine that that board would just have a MCU with PWM capabilities and then some logic surrounding it to manage the PCIe stuff.

So to cut to the chase, sure, it's probably possible to get PWM out of a PC, but for the amount of work that you have to put in, it would be so much easier to write an Arduino program do to whatever you want to do and that interfaces with some software on your computer so you can control it in whatever way you're thinking of.

Or, even better, since you're either trying to make music or a transmission, just buy whatever hardware is meant to do that with. Most instruments have a MIDI interface, and nearly all SDRs will have a buddy program (and possibly an API) that will allow you to control it from a PC.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, straight_stewie said:

Square wave, and it would be possible to convert from one to the other by specifying that the frequency is defined as, say "the duty cycle, adjusted to fit into the output band". Be aware that this method requires special external hardware.

 


The real problem here is that there are both negative and positive parts of the wave. But this can be solved crappily by saying that the actual frequency of the FM wave is double that of the duty cycle (or half that, if you prefer).

As for the rest of the problem, I suppose it's possible to finagle PWM into USB, by outputting the current duty cycle as a number. You know, using USB like it was meant to be used?

The biggest problem here is that all of these methods require external hardware, although if the implementer is smart enough, I suppose he could make a PCIe PWM generator that would make the whole thing simpler. But I imagine that that board would just have a MCU with PWM capabilities and then some logic surrounding it to manage the PCIe stuff.

So to cut to the chase, sure, it's probably possible to get PWM out of a PC, but for the amount of work that you have to put in, it would be so much easier to write an Arduino program do to whatever you want to do and that interfaces with some software on your computer so you can control it in whatever way you're thinking of.

Or, even better, since you're either trying to make music or a transmission, just buy whatever hardware is meant to do that with. Most instruments have a MIDI interface, and nearly all SDRs will have a buddy program (and possibly an API) that will allow you to control it from a PC.

Okay! Could you point me to some informative articles on this type of information (something a highschooler could understand)? It's really interesting to me :) 

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, babadoctor said:

Okay! Could you point me to some informative articles on this type of information (something a highschooler could understand)? It's really interesting to me :) 

Sure, however, to avoid a very large LMGTFY post, I'll just post some subjects you should look up

  • Arduino Basics
  • Arduino PWM
  • Interfacing Arduino with software
  • Software Defined Radio
  • MIDI instruments
  • HAM radio (you will need this if you want to legally transmit anything that is not in the general use bands of your country).

To understand why parts of my reply were sarcasm:

 

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, straight_stewie said:

Sure, however, to avoid a very large LMGTFY post, I'll just post some subjects you should look up

  • Arduino Basics
  • Arduino PWM
  • Interfacing Arduino with software
  • Software Defined Radio
  • MIDI instruments
  • HAM radio (you will need this if you want to legally transmit anything that is not in the general use bands of your country).

To understand why parts of my reply were sarcasm:

 

Arduino basics is a very broad topic! I feel like I am knowledgeable in the pure basics of an arduino. I don't know anything about arduino PWM though. i know what midi is. the whole point was to transmit this over FM frequencies, not just audio. if it was audio i would just use an online service.

 

what was wrong with the PCIE part of your post? to an idiot like me, that sounds reasonable. where is the sarcasm?

 

You can't possibly expect me to understand why the PCIE part of your post was sarcasm, and then just post the specs for pcie 3.0

 

"The biggest problem here is that all of these methods require external hardware, although if the implementer is smart enough, I suppose he could make a PCIe PWM generator that would make the whole thing simpler. But I imagine that that board would just have a MCU with PWM capabilities and then some logic surrounding it to manage the PCIe stuff.
"

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, babadoctor said:

what was wrong with the PCIE part of your post? to an idiot like me, that sounds reasonable. where is the sarcasm?

The document that I linked for PCIe was the PSI-SIG PCIe 3.0 Base specification. It's the document that tells you how PCIe works, and how to build boards that use that interface. It's 893 pages long, and very, very technical. Building a PCIe card is not reasonable at all.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, straight_stewie said:

The document that I linked for PCIe was the PSI-SIG PCIe 3.0 Base specification. It's the document that tells you how PCIe works, and how to build boards that use that interface. It's 893 pages long, and very, very technical. Building a PCIe card is not reasonable at all.

oh i see

 

do you have a degree in engineering?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, babadoctor said:

do you have a degree in engineering?

I'm one semester short. I was dropped from the university do to some, oversights of mine and consequent overreactions from administrators.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, straight_stewie said:

I'm one semester short. I was dropped from the university do to some, oversights of mine and consequent overreactions from administrators.

You were dropped from university for... mistakes? what mistake did you make? 

 

we are getting off topic

my last question is, why does the raspberry pi have this ability to transmit fm signals, but not any other pc?

 

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, babadoctor said:

my last question is, why does the raspberry pi have this ability to transmit fm signals, but not any other pc?

A raspberry pi is not a PC. It is still based on a microcontroller, which means that the "processor" on it has some peripherals that can be used. A normal PC doesn't have this.

That being said, it's possible because some very bored people figured out how to abuse the system quite greatly. Even then, it's not perfect. It still uses a square wave instead of a sine wave.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, straight_stewie said:

A raspberry pi is not a PC. It is still based on a microcontroller, which means that the "processor" on it has some peripherals that can be used. A normal PC doesn't have this.

That being said, it's possible because some very bored people figured out how to abuse the system quite greatly. Even then, it's not perfect. It still uses a square wave instead of a sine wave.

I don't know what the difference between a square wave and a sine wave are, but thank you so much for answering my question!

 

I would also like to thank @DeadEyePsycho and @trag1c for your help

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

Does it have to be exactly 100 mhz or it was just an example?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, krgesu said:

Does it have to be exactly 100 mhz or it was just an example?

It does not need to be exactly 100mhz, but it should be in the FM frequency range, from 88.9mhz to 157.9mhz

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

A quick google search reveals there are thousands upon thousands of fm radio projects for arduino. I mean if you want to directly interface with the hardware arduino is your best bet. Also it natively supports serial communication meaning you can talk with it from your pc. Of course to pull this off you will need some programming knowledge.

Link to comment
Share on other sites

Link to post
Share on other sites

10 minutes ago, babadoctor said:

I don't know what the difference between a square wave and a sine wave are, but thank you so much for answering my question!

Not to be that guy, but a good first step to building an FM transmitter would probably be learning what FM is.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×