Precise signal generation using matlab

  • Permalink
  • submit to reddit
  • Email
  • Follow


Can I generate a signal using MATLAB which is in the order of microseconds( Stays low for 1microsecond and becomes high the next microsecond) and output the same via serial or parallel port?
0
Reply venkata 8/23/2010 4:14:05 AM

See related articles to this posting


On 22/08/10 11:14 PM, venkata wrote:
> Can I generate a signal using MATLAB which is in the order of
> microseconds( Stays low for 1microsecond and becomes high the next
> microsecond) and output the same via serial or parallel port?

*Maybe*. I personally wouldn't count on it, though.

You _might_ be able to do an acceptable job of timing a signal if you 
manage to find an appropriate available hardware-level timer on some 
device, but it would be difficult to do in software unless perhaps you 
are using the RTW.

Asynch serial ports are not designed to run at 1 megabit per second. 
Apparently with 2009a and later, you can run at about 0.92 megabit/s, 
but it would be impossible to control the timing of the bits precisely 
within that framework.


Parallel ports... I'm having to do a bunch of careful reading here.

http://www.bb-elec.com/tech_articles/parallel_port_explained.asp

Look right near the bottom, where it talks about ISA cards supporting 2 
megabytes per second maximum, and PCI cards supporting 5.5 to 6 
megabytes per second maximum. That 5.6 to 6 megabytes per second 
_sounds_ like plenty for your application, but it needs EPP mode to do 
it as ECP mode is (the article says) not supported on PCI cards which 
(the article says) do not support DMA. EPP works with hardware support 
by monkeying with the bus wait states -- and that should raise red flags 
about loss of precision in the timing and about clock jitter.

Perhaps I just haven't been paying attention (a good possibility in this 
matter), but it seems to me that parallel ports these days tend to be 
ECP rather than EPP. Perhaps support for both modes is common; I don't 
do much PC hardware work.


http://www.lvr.com/jansfaq.htm

This article gives more detail on how ISA cards are able to do 2 
megabytes per second. The method is _comparatively_ simple and I would 
_expect_ it to suffer less timing and jitter, but I'm not at all 
certain. And there is the fact that not many systems these days are 
built with ISA slots other than perhaps a compatibility mode.


Now, in general, the process of sending a signal through a parallel port 
involves asserting a signal on to the lines, and when the lines have had 
time to settle, asserting a strobe pulse on a separate line. The 
destination then takes a snapshot of the state of the line, usually 
triggered by the strobe line (leading vs trailing edge is defined in the 
standards but not always adhered to), with there being a window during 
which the source is expected to hold the lines steady (keeping in mind 
signal propagation time). After that the parallel lines are supposed to 
return to ground state -- parallel doesn't inherently mean "synchronous" 
(other than for the 8 data lines): except in the advanced modes the 
general assumption is that it will be a random amount of time before 
there is more data to be transmitted, so except perhaps in some of the 
advanced modes, two output bits in a row that happened to be the same 
would cause two separate drive-up and release-down on the pin, rather 
than just leaving the line in its last state until it is known to need 
to change.

The implication of this for your purpose is that you are going to have 
trouble getting your bit timing to be precise: you may get a million bit 
samples per second, but those are transferred as short-term samples of 
the state of the lines rather than through precise timing of the line 
states themselves. From the beginning of the cycle until the strobe, the 
data line is allowed to slew (and it probably will, as there is no 
inherent active de-bouncing in the technology and the lines will be 
moving from ground each time.) And then again after the strobe period 
slew is allowed.

Really, if you wanted to do more precise bit-hold timing with parallel 
ports, you should be working with the control bits rather than the data 
bits -- some of the control bits are defined as being holdable for 
extended times. The problem with that approach, though, is that you 
would have to do it through low level software control, perhaps in SPP 
mode (10 I/O cycles per byte), and you would never be able to get the 
data rates that you want if you used those modes. The higher the data 
rate you want, the more the work of the control pins is delegated to 
special-purpose state-engine hardware...


So what is the summary here?

A) That if you need precise timing, you are better off using a digital 
control of a device that generates the signal, whether that device be 
custom or a signal generator; and

B) If data rates is the aim rather than signal timing, by the time you 
want data rates of 1 megabits per second, you should probably give up on 
asynch serial or parallel ports, and should instead move to synch 
systems such as T1 or E0 lines, or to ethernet. A bit timing of 1 
megahertz on a four-wire connection is no problem; the E0 maximum rate 
is 1.544 megabits per second (T1 data rate is exactly 7/8 of that.)
0
Reply Walter 8/23/2010 5:33:12 AM

@walter robertson

Thank you for the reply.
0
Reply venkata 9/8/2010 5:04:04 AM
comp.soft-sys.matlab 203855 articles. 540 followers. Post

2 Replies
495 Views

Similar Articles

[PageSpeed] 46


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

I am using PCI 6229 to get a signal and PXI-6133 to send a signal back to my sytem using matlab:
I am using PCI 6229 to get a signal and PXI-6133 to send a signal back to my sytem using matlab: I am using matlab and use both AI and AO in the same loop but they dont work together (I dont see any signal in the Scope). what is the problem? thanks in advance AI = analoginput('nidaq','Dev1'); chan = addchannel(AI,0); duration = 0.0005; %0.5ms second acquisition set(AI,'SampleRate',1000) AO = analogoutput('nidaq','Dev4'); chan_o = addchannel(AO,0); set(AO,'SampleRate',1000) ramp=zeros(100,1); putdata(AO,y') start(AO) ...

need code for generating an ecg signal using fourier series in matlab
i am a biomedical engineering student.i need to generate an ecg signal using fourier series using matlab.so i need the code for it.can anyone suggest me the code . On 28 d=E9c, 16:18, "bhargavi " <navilavanyanbharg...@gmail.com> wrote: > i am a biomedical engineering student.i need to generate an ecg signal us= ing fourier series > =A0using matlab.so i need the code > =A0for it.can anyone suggest me the code > =A0. Hi; try to see this link: http://www.mathworks.com/matlabcentral/fileexchange/10858-ecg-simulation-us= ing-matlab bye On M...

please can any one post the matlab script for these s&#8226; generate 100 random number or use the test data provided by the standard; &#8226; write Convolution Encoder using MATLAB script; Then you n
&#8226; generate 100 random number or use the test data provided by the standard; &#8226; write Convolution Encoder using MATLAB script; Then you need to verify the Convolution Encoder by &#8226; calling MATLAB built in Convolution Encoder function ; &#8226; calling MATLAB built in Viterbi Decoder function vinay vish wrote: > &#8226; generate 100 random number or use the test data provided by the standard; > &#8226; write Convolution Encoder using MATLAB script; > Then you need to verify the Convolution Encoder by > &#8226; calling MATLAB built in ...

Generate dll in msvc++ using matlab generated dll
hi, I generated a dll using the matlab command mcc. Then made a project( win32 console application project) in msvc++ using this dll and other files generated from matlab. Wrote a main function as the procedure in the matlab compiler help. That project run wihout any error and got the correct output. Now I want to generate a dll for the entire project( above mentioned ). How can I use the matlab generated dll for generating dll in msvc++? ...

Using embedded Matlab blocks with few in-signals and multiple out-signals
Hello! This might be a slightly badly formulated question, which I apologize for, but I'm not really getting any air under my wings to get started on this problem. What I have is Simulink, and a user interface from where the signals come, where I will model a simulator with multiple signals. The problem is that with all "ifs", "ors" and "ands" the number of blocks and switches will grow exponentially. What I thought now is that if I could embed a few matlab blocks where I could make most of the calculations to then take out the signals in simulink wou...

About COM objects, generated using Matlab builder, and Matlab Web server
Can someone package his GUI application into a COM object and publish it over the Web using Matlab web server? Is it possible this way that I dont have to create (for any new *.m file) a corresponding *.html or *.php file? Just re-package into a new COM object and re-publish it using matlab web server?? ...

Shall i use the misrosoft Visual c++ code from a m-file generated from matlab in Visual C++ with out matlab runtime environment
undefined ...

7.0 vs. 6.5: (matlab 7.0 does not work) question on using MSVC matlab add-in to generate m-dll to speed-up my program
Dear all, I was using Matlab 6.5 MSVC matlab add-in macro to generate m-MEX-dll used in Matlab for speeding-up my program. I created a new "matlab project" in MSVC 6.0. Then load the m-file "ProcessBitmap.m" which is the m-file I want to convert into MEX dll to use in the matlab command line. Then I built the "dll" file in MSVC 6.0. The generated "ProcessBitmap.dll" can be successfully used in matlab 6.5 command line without any trouble. It can be used inside the matlab command line. Even if I delete the original "m-file", the "ProcessB...

Using matlab to generate noise
I have to create a random number geneator to generate additive noise with zero mean and variance 0.3 The noise then had to be added to a cos function Can anyone give any hints on how to do this? Thanks in advance for any help! this is the code for that x = [-pi:.05:pi]; noise = 0.3.*randn(1,size(x,2)) data = cos(x) + noise B-Riz <briwel06@hotmail.co.uk> wrote in message <14390808.2774.1240263809787.JavaMail.jakarta@nitrogen.mathforum.org>... > I have to create a random number geneator to generate additive noise with zero mean and variance 0.3 The noise then had to be added to...

Generate Stereo using Matlab.
Hi all, Can anyone explain how to generate the stereo and decode it in channel L and R in Matlab. Need some explanation or example please!!! Would appreciate it... Thankz disney_snoopy wrote: > Hi all, > > Can anyone explain how to generate the stereo and decode it in channel L > and R in Matlab. Need some explanation or example please!!! Would > appreciate it... > Thankz Study project / homework? -- Tauno Voipio tauno voipio (at) iki fi disney_snoopy wrote: > Hi all, > > Can anyone explain how to generate the stereo and decode i...

Can you use zlib from Matlab, only using native Matlab code?
Hello, I'm trying to decompress a file using zlib, for use by my Matlab function. Currently I'm doing it by calling Python midway through my function, but I would like to make it so that I don't need to have Python installed on whatever computer I'm trying to run my function on. I was wondering if there was a way for me to use zlib just using native Matlab code. I don't know much about compression/decompression, so I'm open to any suggestions. I've been searching around for a while, and haven't found anything. Thanks very much ...

System Generator using MATLAB
Dear Friends, I am working on system generator whcih is a aprt of MATLAB with Xilinx. I am not understanding how external input and output are given to the Processor of Xilinx board threw System Generator Blocks. Pl help me. ...

How generate signal UWB with Matlab???
Hello, Please help me for to generate a signal uwb with matlab. Thank you ...

Can you use zlib from Matlab, only using native Matlab code? #2
Hello, I'm trying to decompress a file using zlib, for use by my Matlab function. Currently I'm doing it by calling Python midway through my function, but I would like to make it so that I don't need to have Python installed on whatever computer I'm trying to run my function on. I was wondering if there was a way for me to use zlib just using native Matlab code. I don't know much about compression/decompression, so I'm open to any suggestions. I've been searching around for a while, and haven't found anything. Thanks very much On Tue, 05 May 2009 15:24...

How to use look-up tables to generate signals?
I need to generate a set of pulses, switching on and off according to certain switching angles. I understand that it can be done using look-up tables, but i do not have much idea on how to get it done.... Anyone out there who can help? Thanks!! ...

complex signal generation using AD9777
Hello I am currently working on the AD9777 DAC for generating complex (not real) waveforms. I have a couple of questions in this regard. I will be glad if anyone can help me. 1. I observed clock feed through (-50dBc) at the output of the DAC. For example, when I generate a 10 MHz sine wave using a 100 MHz clock, I see spurs at 100 MHz, 200 MHz and 300 MHz. The highest of them is 50 dB below the carrier. Could you please explain the possible sources for the spurs? 2. I am trying to operate the DAC in complex modulation mode to generate signals with a wider bandwidth. The sideband suppressio...

Signal generator using FPGA and DAC
Hello..I'm a university student familiar with the only the basics of VHDL and FPGA implementation..For my project, I'm trying a make a sine wave, ramp, triangular and square wave generator which outputs required wave of required amplitude and required frequency The FPGA is connected with DAC thru I2C bus.. The development board (nanoboard) has on- board freq of 20 mhz...now the dac being connected to the I2c bus can work upto max 400 Mhz..so a suitable clock divisor has to be implemented ..thus a low frequency can be used as SCL input to DAC.. a)Now, for the sine and square wave, I...

VGA signal generator using CPLD
Hello, I am new with CPLD and Verilog. I have made some code and posted on comp.lang.verilog but nobody responded. I need help. I don't know if this code works. I don't know how to make a test module. (I am using ISE Webpack 4.2 and MXE). Thanks. --- http://www.terra.es/personal9/listaco/VGAsignal.html (Project) Here goes: ====================================================================== /* * VGA 800x600 @ 60 Hz Signal Generator using Verilog * ================================================== * * Date: 25 November 2004 * * Intended CPLD: Xilinx XC9536XL (or XC9572...

how to generate Excell file using matlab
hi all. i have some problem to generate Excell file using matlab. The data that should be shown in Excell would be like this: Num0 Num1 Num2 total_sum 11 12 16 average 2.0 3.0 3.5 what is the source code in Matlab should i use to show that data in Excell? Thanks On Apr 12, 5:41=A0am, "nashriq " <adeque...@yahoo.com> wrote: > hi all. i have some problem to generate Excell file using matlab. The dat= a that should be shown in Excell would be like this: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Num0 Num1 Num2 > total_sum =A0 =A01...

signal and communication prging using matlab
Dear all, i am a student who is currently working on a project to measure the performance of a Additive White Gaussian Noise Channel using MATLAB. My project starts of with feeding a speech or voice input, sampling and then quantising this signal and encoding it into digital representation form. This digital signal will be passed through an AWGN channel and then modulated using a MPSK technique. Finally the modulated signal will be passed through a symbol detector to calulate the symbol and bit error rate. i have written the beginning but I need some advice and help as i get stuck because ...

How to get the envelope of a signal using matlab
Hello all, please does anyone know how to get the envelope of a speech signal using matlab, or is there any well known algorithm to do so? Thanks alot ...

Generating an analog signal using PXI
Hello everyone, &nbsp; I am trying to write a program using LabVIEW 8.0&nbsp;that can be used to send&nbsp; an analog DC signal (0 - 5 V DC) to an inverter. My hardware includes PXI&nbsp;8196 (PC host) and PXI&nbsp;8196&nbsp;(RT Target). &nbsp;Both have the modules PXI 4472 and PXI 6602. My knowledge about how to use these devices to generate an analog signals is very basic. Could any one please give me some hints on how to get started. &nbsp; Thank you very much &nbsp; Mike &nbsp; June, 11 PXI 4472 is a DSA card and&nbsp;has8 Analog Input channel...

Using Matlab-generated dll in MSVC
I created a simple m-file 'Add.m' which contains the following: ==================================================== function c = Add(a, b) c = a + b; ==================================================== I generated the dll using: mcc -g -l Add I built a little dialogue-based application in MSVC using MFC, where I created a button on which the following code is executed: ==================================================== bool fResult = false; fResult = mclInitializeApplication(NULL, 0); fResult = AddInitialize(); =================================================...

Generating random networks using Matlab
Hi Everyone I want to generate random networks where each network contains from 2 to 20 nodes. I have done it for networks with equal number of nodes (e.g 2,3,4,5,....). Can anybody guide me how to do that for networks where each network can have different number of nodes. My small script is : n=5; p=0.5; for i=1:1:8 G = rand(n,n) < p; G = triu(G,1); G = G + G' end As you can see that through this script i can get as many networks as i want by just increasing the last value in the for loop but each network will have a fixed number of nodes(e.g 5 in this case since n=5). So, i want...