From: BUI Dang Thanh on
Dear all,

I am working with Matlab Simulink (Matlab R2009b) for DSP (Digital Signal Controller), i need a digital sinwave so that i create the steps following:

1. Testing with continuous model:
+ A Pulse generator at 500 Hz connecte with
+ A Band pass Filter at f0=500Hz (Q=100); H(s)=([31.42 0], [1 31.42 9869604])
+ A scope display the result,

With some parameters: Simulation -> Configuration Parameters -> Fixed-step; ode3; t(sample)=1e-5

It works well, it means the result is a sinwave at 500Hz

2. Testing with discrete model:
+ A Pulse generator at 500 Hz connecte with
+ A Band pass Filter at f0=500Hz (Q=100); i used the command "H(z)=c2d(H(s), 0.000005,'foh')" for converting from continuous to discrete time models. The results is
H(z)=([7854e-5 -4.113e-9 -7.854e-5], [1 -2 0.9998])
+ A scope display the result

With some parameters: Simulation -> Configuration Parameters -> Fixed-step; discrete; t(sample)=1e-5/ Auto/ 5e-6 ... (i tested with some different values)

But it does not work

Please help me to explain why it does not work

P/S: I have already seen an exemple * to creat a digital sinwave by creating a table, but i prefer this method.
* http://www.mathworks.com/products/simulink/demos.html?file=/products/demos/shipping/simulink/sldemo_wavethd_script.html
From: Steven Lord on

"BUI Dang Thanh" <buidangthanh(a)yahoo.com> wrote in message
news:hvn5jt$eq3$1(a)fred.mathworks.com...
> Dear all,
>
> I am working with Matlab Simulink (Matlab R2009b) for DSP (Digital Signal
> Controller), i need a digital sinwave so that i create the steps
> following:
>
> 1. Testing with continuous model:
> + A Pulse generator at 500 Hz connecte with
> + A Band pass Filter at f0=500Hz (Q=100); H(s)=([31.42 0], [1 31.42
> 9869604])
> + A scope display the result,
>
> With some parameters: Simulation -> Configuration Parameters ->
> Fixed-step; ode3; t(sample)=1e-5
>
> It works well, it means the result is a sinwave at 500Hz
>
> 2. Testing with discrete model:
> + A Pulse generator at 500 Hz connecte with
> + A Band pass Filter at f0=500Hz (Q=100); i used the command
> "H(z)=c2d(H(s), 0.000005,'foh')" for converting from continuous to
> discrete time models. The results is H(z)=([7854e-5 -4.113e-9 -7.854e-5],
> [1 -2 0.9998])
> + A scope display the result
>
> With some parameters: Simulation -> Configuration Parameters ->
> Fixed-step; discrete; t(sample)=1e-5/ Auto/ 5e-6 ... (i tested with some
> different values)
>
> But it does not work
> Please help me to explain why it does not work

First you need to define what you mean by "it does not work". Does it give
you a different answer than the one you expect? Does it throw a warning or
error? Does it cause your computer to spontaneously burst into flames?

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com