VGAtoBaseband: Unterschied zwischen den Versionen
Siro (Diskussion | Beiträge) K (+libraries) |
Siro (Diskussion | Beiträge) (+update software description) |
||
(15 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
{{ProjektInfoBox | {{ProjektInfoBox | ||
|name = | |name = VGAtoIQBaseband | ||
|status = | |status = stable | ||
|image = | |image = | ||
|description = use the VGA port to generate I/Q baseband signals | |description = use the VGA port to generate I/Q baseband signals | ||
|author = [[Benutzer:siro|siro]] | |author = [[Benutzer:siro|siro]] | ||
|username = | |username = siro | ||
|version = 0. | |version = 0.2 | ||
|update = | |update = | ||
|platform = | |platform = Linux | ||
|license = | |license = mixed | ||
|download = [https://www.das-labor.org/trac/browser/host-apps/VGAtoIQBaseband] | |download = [https://www.das-labor.org/trac/browser/host-apps/VGAtoIQBaseband] | ||
}} __NOTOC__ | }} __NOTOC__ | ||
== Description == | |||
This software provides an highspeed, easy to use DAC interface using the VGA compatibel CRTC in your graphics card. It reads from stdin and generates appropriate analog signals on the VGA connector. Those signals could for example be used to feed a rf-modulator. | |||
This software is intended to be used with [[SDRT]] or [[SDRT2]]. | |||
== Requirements == | == Requirements == | ||
Zeile 22: | Zeile 26: | ||
* GL_ARB_pixel_buffer_object for efficient CPU to GPU transfers | * GL_ARB_pixel_buffer_object for efficient CPU to GPU transfers | ||
== | == What it does == | ||
[[Datei:Vgatoiqbaseband.png]] | |||
== Software == | == Software == | ||
The current version runs on any symbolrate, recommended are 5MSymbols/s or more.<br> | The current version runs on any symbolrate, recommended are 5MSymbols/s or more.<br> | ||
Every symbol is a complex number, that contains an I (real) and Q (imag) value.<br> | Every symbol is a complex number, that contains an I (real) and Q (imag) value.<br> | ||
By default the signal is lowpass filtered using convolutional sinc function. | By default the signal is lowpass filtered using convolutional sinc function. Low pass filtering can be disable using -n argument. | ||
The I/Q values are | The I/Q values are read from stdin. The software accepts BYTE, SHORT and FLOAT as input values. | ||
The real part (I) is assigned to the RED and the imag part (Q) to the GREEN channel, while the BLUE channel is set to 0.5f. | The real part (I) is assigned to the RED and the imag part (Q) to the GREEN channel, while the BLUE channel is set to 0.5f. | ||
8bit and 10bit VGA Graphic cards are supported. | 8bit and 10bit VGA Graphic cards are supported. | ||
<br> | |||
<br> | |||
vgatobaseband uses the first VGA output found. If none found it uses the first output that is active. | |||
The VGA output has to be configured first using xrandr, arandr, ....<br>The coordinates are saved, a new modeline is added and set. | |||
<br> | |||
All baseband signals contains positive as well as negative numbers. If your signal range covers -1.0f to 1.0f you have to convert them.<br> | |||
newval = (float2)(oldval.i/2 + 0.5f, oldval.q/2 + 0.5f) | |||
The ''newval'' is now in range 0.0f to 1.0f and can be used with this programm. | |||
<br> | |||
Due to most GPU only having 8bit DACs the floats are converted into a range from -127 to 127 (using the blue channel as differential reference). | |||
== Arguments == | |||
./vgatoiqbaseband [ARGS] | |||
reads data from stdin | |||
ARGS could be: | |||
-n disable fragmentshader | |||
--nofilter disable fragmentshader | |||
-v be verbose | |||
--verbose same as -v | |||
-display DISPLAY Specify the X server to connect to. If not specified, the value of the DISPLAY environment variable is used. | |||
-direct force direct rendering | |||
-t generates test patterns | |||
--testpattern same as -t | |||
-d <x> convolutional depth | |||
default: 17 | |||
-f <c> same as --freq (float) | |||
--freq <c> set convolutional filter cut-of frequency to c Mhz (c is float) | |||
default: 3.81 Mhz | |||
-h same as --help | |||
--help print help message | |||
-z <x> 4 for float, 2 for ushort, 1 for uchar | |||
--datasize <x> same as -z | |||
only if compiled with libXrandr support: | |||
-cutofright <n> cutof n rightmost pixels (hsync) | |||
default: 1 | |||
-cutofbottom <m> cutof m bottommost pixels (vsync) | |||
default: 2 | |||
-pclk <x> use a pixelclock of x Mhz | |||
default: 64 | |||
=== Examples === | |||
Set the VGA position first: | |||
xrandr --output VGA-0 --right-of LVDS --auto | |||
xrandr --output VGA-0 --right-of LVDS | |||
adjust ''VGA-0'' and ''LVDS'' according to your system. | |||
cat inputfile.raw > ./vgatoiqbaseband -v | |||
This will read from the file inputfile.raw .<br> | |||
./vgatoiqbaseband -v -t | |||
This will generate test paterns. | |||
== | == Libraries == | ||
* libglut | |||
* libglu | |||
* libgl | |||
* libpthread | |||
''You may also use'' | |||
* libxrandr | |||
* libX11 | |||
== Bandwidth == | '''Debian packages:''' | ||
* freeglut3-dev | |||
* libglu1-mesa-dev | |||
* libgl1-mesa-dev | |||
* libxrandr-dev | |||
== OFDM Bandwidth == | |||
OFDM useful carriers to total carriers ratio: 1705 / 2048 = 0.832 | OFDM useful carriers to total carriers ratio: 1705 / 2048 = 0.832 | ||
{| {{Prettytable}} | {| {{Prettytable}} | ||
! DAC clock [Mhz]!! Msymbols/s!! carrier ratio !! Bandwidth | ! DAC clock [Mhz]!! Msymbols/s!! carrier ratio !! 3dB Bandwidth Mhz | ||
|- | |- | ||
|64 | |64 | ||
Zeile 92: | Zeile 132: | ||
|} | |} | ||
== | == Phase shift == | ||
As phase-shifting OFDM symbols results in malformed spektrum, the horizontal sync is padded with blanking pixel to make sure the sync has the same size as all other symbols. | |||
== Interpolation Filter == | |||
The convolutional filter is critical in this application. Using OFDM 8 Mhz bandwidth the I and Q channel maximum frequency is 3.81 Mhz. The DAC sampling rate is 9.142 MSPS which is enough to reconstruct all frequencies, but due to the low sampling rate the baseband signal contains aliasing artefakts. | |||
To remove those artefakts a si-filter is neccessary, including an interpolation DAC, which is running at much higher sampling rate.<br> | |||
This is done by the fragment shader, implemented in shader.cpp. | |||
The GPU has to fetch, multiply, add and store at least ''' <sampling rate> * <conv_depth> ''' pixels | |||
{| {{Prettytable}} | |||
! DAC clock [MSps]!! GPU !! Driver !! max Kernel_size | |||
|- | |||
|64 | |||
|RV710 | |||
|Mesa 9.0.2 | |||
|7 | |||
|- | |||
|64 | |||
|RV710 | |||
|fglrx 8.97.2 | |||
|17 | |||
|- | |||
|64 | |||
|RV910 | |||
|fglrx 12.104 | |||
|33 | |||
|- | |||
|recommended | |||
| | |||
| | |||
|27 or more | |||
|} | |||
A hardware low-pass filter is required to remove remaining aliasing effects. | |||
. | == Screen size == | ||
On fglrx the default screen size is 1600x1600. To increase this limit generate an xorg.conf using 'aticonfig --initial' and add this line: | |||
[...] | |||
Section "Screen" | |||
Identifier "aticonfig-Screen[0]-0" | |||
Device "aticonfig-Device[0]-0" | |||
Monitor "aticonfig-Monitor[0]-0" | |||
DefaultDepth 24 | |||
SubSection "Display" | |||
Viewport 0 0 | |||
Virtual 3600 1600 | |||
Depth 24 | |||
EndSubSection | |||
EndSection | |||
The line containing "Virtual" is critical. | |||
This should be no problem on Mesa as the default screen size is 8196x8196. | |||
== | == TODO == | ||
* | ** You may use a custom edid, see here for more details [[HackingVGAforFun]]. | ||
* | |||
== Links == | == Links == | ||
Zeile 118: | Zeile 193: | ||
* http://bk.gnarf.org/creativity/vgasig/ | * http://bk.gnarf.org/creativity/vgasig/ | ||
* http://www.sevenforums.com/tutorials/7947-force-dvi-hdmi-resolutions-refresh-rates-4.html | * http://www.sevenforums.com/tutorials/7947-force-dvi-hdmi-resolutions-refresh-rates-4.html | ||
[[Category:HowTo]] | |||
[[Category:Software]] |
Aktuelle Version vom 7. November 2013, 09:13 Uhr
VGAtoIQBaseband Release status: stable [box doku] | |
---|---|
Description | use the VGA port to generate I/Q baseband signals |
Author(s) | siro (siro) |
Last Version | 0.2 () |
Platform | Linux |
License | mixed |
Download | [1] |
Description[Bearbeiten | Quelltext bearbeiten]
This software provides an highspeed, easy to use DAC interface using the VGA compatibel CRTC in your graphics card. It reads from stdin and generates appropriate analog signals on the VGA connector. Those signals could for example be used to feed a rf-modulator. This software is intended to be used with SDRT or SDRT2.
Requirements[Bearbeiten | Quelltext bearbeiten]
- PC with VGA adapter
- OpenGL with Direct Redering
- Vsync enabled
- Software-defined Radio Transmitter that generates I/Q Signals
- GL_ARB_fragment_program to use the low-pass filter
- GL_ARB_pixel_buffer_object for efficient CPU to GPU transfers
What it does[Bearbeiten | Quelltext bearbeiten]
Software[Bearbeiten | Quelltext bearbeiten]
The current version runs on any symbolrate, recommended are 5MSymbols/s or more.
Every symbol is a complex number, that contains an I (real) and Q (imag) value.
By default the signal is lowpass filtered using convolutional sinc function. Low pass filtering can be disable using -n argument.
The I/Q values are read from stdin. The software accepts BYTE, SHORT and FLOAT as input values.
The real part (I) is assigned to the RED and the imag part (Q) to the GREEN channel, while the BLUE channel is set to 0.5f.
8bit and 10bit VGA Graphic cards are supported.
vgatobaseband uses the first VGA output found. If none found it uses the first output that is active.
The VGA output has to be configured first using xrandr, arandr, ....
The coordinates are saved, a new modeline is added and set.
All baseband signals contains positive as well as negative numbers. If your signal range covers -1.0f to 1.0f you have to convert them.
newval = (float2)(oldval.i/2 + 0.5f, oldval.q/2 + 0.5f)
The newval is now in range 0.0f to 1.0f and can be used with this programm.
Due to most GPU only having 8bit DACs the floats are converted into a range from -127 to 127 (using the blue channel as differential reference).
Arguments[Bearbeiten | Quelltext bearbeiten]
./vgatoiqbaseband [ARGS]
reads data from stdin
ARGS could be:
-n disable fragmentshader --nofilter disable fragmentshader -v be verbose --verbose same as -v -display DISPLAY Specify the X server to connect to. If not specified, the value of the DISPLAY environment variable is used. -direct force direct rendering -t generates test patterns --testpattern same as -t -d <x> convolutional depth default: 17 -f <c> same as --freq (float) --freq <c> set convolutional filter cut-of frequency to c Mhz (c is float) default: 3.81 Mhz -h same as --help --help print help message -z <x> 4 for float, 2 for ushort, 1 for uchar --datasize <x> same as -z
only if compiled with libXrandr support: -cutofright <n> cutof n rightmost pixels (hsync) default: 1 -cutofbottom <m> cutof m bottommost pixels (vsync) default: 2 -pclk <x> use a pixelclock of x Mhz default: 64
Examples[Bearbeiten | Quelltext bearbeiten]
Set the VGA position first:
xrandr --output VGA-0 --right-of LVDS --auto
adjust VGA-0 and LVDS according to your system.
cat inputfile.raw > ./vgatoiqbaseband -v
This will read from the file inputfile.raw .
./vgatoiqbaseband -v -t
This will generate test paterns.
Libraries[Bearbeiten | Quelltext bearbeiten]
- libglut
- libglu
- libgl
- libpthread
You may also use
- libxrandr
- libX11
Debian packages:
- freeglut3-dev
- libglu1-mesa-dev
- libgl1-mesa-dev
- libxrandr-dev
OFDM Bandwidth[Bearbeiten | Quelltext bearbeiten]
OFDM useful carriers to total carriers ratio: 1705 / 2048 = 0.832
DAC clock [Mhz] | Msymbols/s | carrier ratio | 3dB Bandwidth Mhz |
---|---|---|---|
64 | 9.14285 | 0.832 | 7.61 |
56 | 8.000 | 0.832 | 6.66 |
48 | 6.8571 | 0.832 | 5.71 |
Phase shift[Bearbeiten | Quelltext bearbeiten]
As phase-shifting OFDM symbols results in malformed spektrum, the horizontal sync is padded with blanking pixel to make sure the sync has the same size as all other symbols.
Interpolation Filter[Bearbeiten | Quelltext bearbeiten]
The convolutional filter is critical in this application. Using OFDM 8 Mhz bandwidth the I and Q channel maximum frequency is 3.81 Mhz. The DAC sampling rate is 9.142 MSPS which is enough to reconstruct all frequencies, but due to the low sampling rate the baseband signal contains aliasing artefakts.
To remove those artefakts a si-filter is neccessary, including an interpolation DAC, which is running at much higher sampling rate.
This is done by the fragment shader, implemented in shader.cpp.
The GPU has to fetch, multiply, add and store at least <sampling rate> * <conv_depth> pixels
DAC clock [MSps] | GPU | Driver | max Kernel_size |
---|---|---|---|
64 | RV710 | Mesa 9.0.2 | 7 |
64 | RV710 | fglrx 8.97.2 | 17 |
64 | RV910 | fglrx 12.104 | 33 |
recommended | 27 or more |
A hardware low-pass filter is required to remove remaining aliasing effects.
Screen size[Bearbeiten | Quelltext bearbeiten]
On fglrx the default screen size is 1600x1600. To increase this limit generate an xorg.conf using 'aticonfig --initial' and add this line:
[...] Section "Screen" Identifier "aticonfig-Screen[0]-0" Device "aticonfig-Device[0]-0" Monitor "aticonfig-Monitor[0]-0" DefaultDepth 24 SubSection "Display" Viewport 0 0 Virtual 3600 1600 Depth 24 EndSubSection EndSection
The line containing "Virtual" is critical. This should be no problem on Mesa as the default screen size is 8196x8196.
TODO[Bearbeiten | Quelltext bearbeiten]
- You may use a custom edid, see here for more details HackingVGAforFun.