06 March 2007

delay in simulink with adjustable parameters and weekly update


Problems:
  • How do I make in simulink a vector with N zeros and thereafter a one, while the N is supplied by an input? I didn't find blocks for creating matrices, so I wanted to do it with a matlab code snippet. But this gave a lot of strange problems. delayVector = [zeros(N,1);1]; This was my function, but the debugger said that this N gives problems and that the matrix must be constant or non-empty. Has it got something to do with iterations? I don't know what to do with this, so temporally I will use a fixed matrix.
    Non-constant expression or empty matrix.
    This expression must be constant because its value determines the size or class of some expression.
    This is still a problem after applying toons proposal (see comment). The identity matrix seems not to output a matrix. Here you see the error code simulink gives us:
    Element 1 of port 2 in 'effectSystem/Delay1/Selector' has a value of 257. This value is not within the range of permissible values (1 through 1) that allows selection of a valid input data element.

    I tried narrowing down all possible causes so far that I ended with another little document:
    And even this won't work. So I ain't got no clue for what's happening.
  • Now I got another problem with our FIR filter: there would be a singularity problem.
    Trouble solving algebraic loop containing 'delaySubSystem/Subsystem/ -N z' at time 0. Stopping simulation. There may be a singularity in the solution. If the model is correct, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
    I don't understand what they mean, and even so I can't find a way to adjust the step size like they suggest.



weekly update

First we talked about the things we did and didn't understand during the last days.
And of course our discovery of extensive literature on the topic and what would be our place now. Is it changed or not?
For the presentation on friday:
Tell something general, about the effects, about the feature extractions, about the proposed mapping method of Verfaille. And ending with our future vision.
As we think now there are two ways to continue from here:
  1. Or we try the general framework idea and after that we try all sorts of combinations
  2. Or we try some specific new effects out, but then we don't have to generalize
Tomorrow we schedule the presentation making.

2 comments:

Anonymous said...

probleem 1 (omslachtige oplossing maar het werkt wel): eerst maak je een (N+1)x(N+1) identity matrix met blokje Signal Processing Blockset -> Signal Processing Sources -> Identity Matrix. je kan daar in de parameters een optie aanvinken waardoor je de gewenste dimensie (N+1) aan de ingang kan aanleggen. vervolgens selecteer je van deze matrix de laatste kolom met het blokje Simulink -> Signal Routing -> Selector. het resultaat is dan een kolomvector met N nullen, gevolgd door een 1.

probleem 2: ik vermoed dat Simulink reclameert omdat hij een gesloten lus zonder delay-elementen ziet in Subsystem2. jouw DF FIR blok bevat weliswaar geen delayvrij pad, maar in theorie zou je tijdens de simulatie N=0 kunnen zetten dan is er een algebraische lus (=gesloten lus zonder delay). en dat laat Simulink dus niet toe, zelfs als is N verschillend van 0. wat je best doet is voor het DF FIR blok toch een eenheidsdelay z^{-1} invoegen, en dan eventueel N eentje kleiner maken dan nodig. ik hoop dat je dit een beetje begrijpt.

groetjes

toon

ronny said...

another possible solution (as the first one doesn't work):
The idea is to retry the m-function idea, but with other blocks.
Multiple Inputs and Outputs

Simulink blocks can have multiple inputs and multiple outputs. However, the MATLAB Fcn block and the Fcn block support only a single input and a single output, and the Fcn block can output only a scalar. When you use these blocks, you can use a Mux block to combine the inputs and a Demux block to separate the outputs.

Level 2 M-file S-functions, Stateflow, and Embedded MATLAB Function blocks support multiple inputs and outputs. M-file S-functions provide an added capability—they can be written to automatically adapt to their context. For example, you can write an M-file S-function so that the number of inputs and outputs depends on a parameter much like the Sum block.