Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Binary Data Source (Simulink Problem)

394 views
Skip to first unread message

Islam Galal

unread,
Jan 7, 2011, 4:39:04 PM1/7/11
to
Hi All,

I'm New to Matlab & Simulink

but i Made many communication Systems last year
but i always have problem when i try to make Binary Data Source

i used the (Bernoulli Binary Generator) but its no use cause there is no data rate (the output Data rate (Rb))

and the FFT of the O/P is Not Sinc Square Function as if you see the O/P of it in vector scope you can tell that its not Rect Pulses.

So i made one with my self by (Embedded MATLAB Function) and here the code

function z = fcn()
x = rand ();
y = round (x);
w = y*1;
z = 2*(w-0.5);

%the O/P is Random Data NRZ Code (-1,1)

but the problem is the same the O/P is Still Continuous and there no data rate specified
so what i can do to make it?

All I Want is Binary Data Source (Pure Random Rect Pulses) With :-

1- Discrete Domain
2- That Data Rate Or Frequency Specified (And if how to calculate it)

Please Help Me On This Problem.

Thanks In Advance
I.G

Rick Rosson

unread,
Jan 7, 2011, 6:50:25 PM1/7/11
to
If you double-click on the Bernoulli Binary Generator block, a dialog box
will appear that allows you to set various parameters. One of the
parameters is the 'Sample Time'. The Sample Time is simply the reciprocal
of the data rate, since the block generates one bit per sample. In other
words:

Ts = 1/Rb

where Ts (in seconds per sample) is the sample time and Rb is the data rate
(in bits per second).

So all you need to do is enter 1/Rb in the field for the Sample Time.

HTH.

Rick

"Islam Galal" <islam_g...@yahoo.com> wrote in message
news:ig815o$789$1...@fred.mathworks.com...

Islam Galal

unread,
Jan 7, 2011, 7:50:21 PM1/7/11
to
Thanks Rick Rosson

but as i said that will not give you a correct O/P
Here is what i Mean

[URL=http://img823.imageshack.us/i/39803255.jpg/][IMG]http://img823.imageshack.us/img823/2153/39803255.th.jpg[/IMG][/URL]

Uploaded with [URL=http://imageshack.us]ImageShack.us[/URL]

the spectrum is not Sinc^2

or the Time Signal Is Rect Pulses (Some of them is Triangle so is that Binary)

Thanks in advance

I.G

"Islam Galal" wrote in message <ig815o$789$1...@fred.mathworks.com>...

Islam Galal

unread,
Jan 7, 2011, 7:59:05 PM1/7/11
to
Sorry For the Link

But Here is it

http://img823.imageshack.us/img823/2153/39803255.jpg

Thanks

Rick Rosson

unread,
Jan 7, 2011, 10:01:51 PM1/7/11
to
The output of the Bernoulli Binary Generator block is a single instance of a
discrete-time random process, which generates either a 0 or a 1 at a regular
periodic time step. It is not a continuous-time signal, and it is not
deterministic. You should not expect to see rectangular pulses, because
that is not what it generates. You can plot the output as rectangular
pulses, or triangular pulses, or pulses of any shape you care to use, but
that does not change the fact that it is discrete-time and stochastic. If
you want to see rectangular pulses, try using the standard time-based scope
block instead of the vector scope.

Incidentally, the only "correct" way to plot it is as a stem-and-leaf plot,
which shows the signal as it actually is.

You can also take the FFT of the signal, but again, this will only give you
the spectrum of a single instance of the random process. The correct way to
view the spectrum is to compute the auto-correlation of the random process,
and then take the FFT, which will give you the Power Spectral Density.
Since each sample is by definition independent of all of the other samples,
the autocorrelation is simply the discrete-time unit impulse function, and
the PSD is therefore constant across all frequencies.

HTH.

Best,

Rick

"Islam Galal" <islam_g...@yahoo.com> wrote in message

news:ig8csp$9m4$1...@fred.mathworks.com...

0 new messages