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 203112 articles. 525 followers. Post

2 Replies
444 Views

Similar Articles

[PageSpeed] 12


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

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...

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) ...

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++? ...

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...

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 ...

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!! ...

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...

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...

How generate Frequency-Hopped signal in Matlab?
Hi: Have anyone know how to generate Frequency-Hopped signal in Matlab? Thank you! ...

optimal signal processing using matlab
hi plz solve this problems ,urgent plz give me solution Task 1 Least Squares Linear Curve Fitting A key part in the course is the least squares formulation. Your task is to derive a formulation for least squares linear curve fitting. Assume a set of N measured sample pairs (xn, yn), and that yn depends on xn as yn = kxn +m+&#957;n where k and m are real-valued constants and &#957; is unknown zero-mean white Gaussian noise with variance &#963;2. The least squares linear curve fitting problem finds the parameters k and m such that an error function is minimized in...

How to implement a digital signal using matlab
Please somebody tell me how to implement(draw a graph) for a digital signal like 10111011110111 "Melaka Gunasekara" <donmelaka@gmail.com> wrote in message <gg0fhd$61l$1@fred.mathworks.com>... > Please somebody tell me how to implement(draw a graph) for a digital signal like 10111011110111 a=[1 0 1 1 1 0 1 1 1 1 0 1 1 1]; stairs(a) Than you very much David! ...

How to generate this time-domain signal in matlab...
Plot x(t) http://i42.tinypic.com/ir0pdj.jpg from t=-3 to 3 You can use switch with floor: t=... switch floor(t) case -3 % -3<=t<-2 x=0; case -2 % -2<=t<-1 x=t+3; case -1 % -1<=t<0 x=1; case 0 % 0<=t<1 x=1; case 1 % 1<=t<2 x=-t+3; case 2 % 2<=t<3 x=0; end ----------------------------------------- Maxim Vedenev, MATLAB Custom Programming vedenev@ngs.ru http://simulations.narod.ru/ joesam <kwei88@gmail.com> wrote in message <26629693.1233860851876.JavaMail.jakart...

generating partial coherence using MATLAB
help! I need some inspiration and I havent got a clue where to start. I'm trying to get some results coherence/partial coherence using MATLAB. Firstly, i need to experiment using a random number generator and develop psd,csd etc. for 2, 3 and 4 channels. where do i start? any help would be much appreciated. Thanks Yash yash wrote: > help! I need some inspiration and I havent got a clue where to start. > I'm trying to get some results coherence/partial coherence using > MATLAB. Firstly, i need to experiment using a random number generator > and develop psd,csd etc. for ...