Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!13g2000prl.googlegroups.com!not-for-mail
From: Justin <enigma.dark.666@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Using finite signals in Simulink
Date: Wed, 4 Nov 2009 20:05:36 -0800 (PST)
Organization: http://groups.google.com
Lines: 56
Message-ID: <87186fcb-173b-4b3f-958b-b2b51791cf59@13g2000prl.googlegroups.com>
References: <hcqnh2$2sk$1@fred.mathworks.com> <hct15h$1fe$1@fred.mathworks.com>
NNTP-Posting-Host: 129.8.229.22
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1257393936 24880 127.0.0.1 (5 Nov 2009 04:05:36 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 5 Nov 2009 04:05:36 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 13g2000prl.googlegroups.com; posting-host=129.8.229.22; 
	posting-account=cHWMZAoAAABIZY3ymAB1bmc_zRuSswJs
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.0.15) 
	Gecko/2009101601 Firefox/3.0.15 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:582610


On Nov 4, 3:02 pm, Idin Motedayen-Aval
<run.signat...@MATLAB.for.email> wrote:
> Justin wrote:
> > We are using simulink in order to play a finite file. We converted an audio file into a sample and time array and are using the from workspace simulink block in order to upload the needed data. However, before we can see the data on a scope, the signal has already passed through the system, and therefore we cannot see anything but 0. What we want to do is to essentially trigger the sending of the signal  whenever we so choose (i.e. a switch). However, whenever we use a switch the signal is sent in the background. Is there a way to permanently save the signal from workspace into the simulink model and then trigger it when we want it to send? We have already attempted to use an embedded matlab function in order to load the data from workspace but it gives an error about command duality.
>
> Justin,
> Three things come to my mind:
> 1. Why don't you set the "From Workspace" block to "Cyclic repetition"
> after the data runs out?
> 2. If cyclic repetition is not an option, you can use an enabled
> subsystem (i.e. put the source block inside an enabled subsystem, and
> enable that subsystem when you need the data to be sent).
> 3. If you have Signal Processing Toolbox, you can read audio files
> directly using a "From Wave file" or "From multimedia file" blocks.
>
> btw, Embedded MATLAB is probably complaining because you're using a
> syntax like this:
> load foo.mat
> This is a command-line type syntax that is not allowed; you must use
> function-style syntax for everything:
> load('foo.mat')
> And if you use load, remember to declare the "load" function as
> eml.extrinsic since it's not supported natively in Embedded MATLAB.
>
> HTH,
> Idin
>
> --
> Idin Motedayen-Aval
> The MathWorks, Inc.
> zq=[4 2 5 -15 -1 -3 24 -57 45 -12 19 -12 15 -8 3 -7 8 -69 53 12 -2];
> char(filter(1,[1,-1],[105 zq])), clear zq

thanks for replying. I have tried all of your suggestions. However,
the from .wav file block is not compatible with the mpc555 blockset
that we are using (this will be placed on an embedded system).
Additionally, the cyclic repetition  is not an option since the signal
needs to be triggered by an input (logical 1). The enabled system
seemed promising, however, the signal still sends out even if it is
not enabled ( once it is triggered, it stays at a zero output).
However, when the trigger was left on and then the simulation was
carried out, the audio signal played as usual, however we could not
trigger it. We tried the embedded matlab function, but it will not
allow us to output the values located in the loaded file it returns an
error telling us that the output is not numeric. Is this a problem
with syntax?