Simulink DSP Simulations with Noise: Looking for best practices

5 visualizaciones (últimos 30 días)
Florian Rössing
Florian Rössing el 6 de Sept. de 2022
Respondida: Florian Rössing el 14 de Sept. de 2022
Hi everyone,
I have a nice task at hand to be implemented with matlab and simulink and i am looking for some tipps and best practices to make my live a little more easy, and avoid ending up with a messy set of code and models. (In fact, thats what I did first, now I want to make it cleaner, in order to get rid of the headaches this gives me.)
I want to simulate different DSP components to test their useability in a given system.
Lets start with the input generation, I have a signal that is paramterized and a parameter set on which to evaluate it.
Picture Amplitudes ranging from 0 to 500 and widths ranging from 1ns to 100 us. So I need to pick from these ranges a set of values, like 10 to 100 values of each and simulate all combinations of those.
Then I have noise with different possible RMS values, where I would need to also use 5 to 50 test cases.
And then my models also have a set of parameters to be tested, typical is always the ADC sampling used and the ADC Bit resolution, but it might also be thresholds or correction parameters.
And then, as the simulations involve random noise, we need to repeat each combination of parameters at least 100 times.
The load of simulations could be reduced by reducing the set of input parametersm eg it makes no sense simulating, when the signal width is smaller than the ADC sampling time.
In my first development approach I realized that having a set of pregenerated signals for all parameters is not feasible due to limited RAM.
I opted for nested loops where I just loop over all Model Parameters, all Signal Parameters and all Noise values and in every loop itteration setup a single simulation and run it. This has the benefit that I can alsodirectly reduce the simulation output, to save more RAM there.
Simulation outputs are usualy estimators for the input parameters of my signal (Amplitude, Time Width) and come with an acompanying VALID signal, so that I do not need to store the whole output time series.
In the end I want to see how the different parameters influence the performance of my DSP blocks, eg how many bits resolution do I need to achieve a certain amplitude resolution.
So storing the outputs in a usefull manner is also important.
The end goal is to convert the best approaches to HDL.
If you cam down here without screaming, thank you very much already. Do you maybe have tipps for me?
I am glad for every help, be it usefull links for stuff i could read on this, or direct advise.
Scincerely,
FlR

Respuestas (2)

Kiran Kintali
Kiran Kintali el 7 de Sept. de 2022
You might want to get started with this
HDL Coder Evaluation Reference Guide
There are several signal processing examples for MATLAB to HDL here.
  1 comentario
Florian Rössing
Florian Rössing el 8 de Sept. de 2022
Thank you very much, this helps with some of my issues. I will update my question to reflect, which parts have been answered by now.

Iniciar sesión para comentar.


Florian Rössing
Florian Rössing el 14 de Sept. de 2022
I hav worked on researching for this in my free time and got some ideas:
Lets start with the input generation, I have a signal that is paramterized and a parameter set on which to evaluate it.
  • Picture Amplitudes ranging from 0 to 500 and widths ranging from 1ns to 100 us. So I need to pick from these ranges a set of values, like 10 to 100 values of each and simulate all combinations of those.
I thougth about updating to 2022a and use the multiple simulations pane. I am just trying to figure whether there is a way to create design studies in code. For pulse generation I thougth about using a InitFunction that populates a signal that is connected to the model inputs.
  • Then I have noise with different possible RMS values, where I would need to also use 5 to 50 test cases.
For this i thought about using a noise block. Parameters again povided via multiple simulation pane.
  • And then my models also have a set of parameters to be tested, typical is always the ADC sampling used and the ADC Bit resolution, but it might also be thresholds or correction parameters.
  • And then, as the simulations involve random noise, we need to repeat each combination of parameters at least 100 times.
Again Multiple simulations pane. And use a variable that is a counter of how many repetitions we need, that is used with the exhaustive mode.
  • Simulation outputs are usualy estimators for the input parameters of my signal (Amplitude, Time Width) and come with an acompanying VALID signal, so that I do not need to store the whole output time series.
  • In the end I want to see how the different parameters influence the performance of my DSP blocks, eg how many bits resolution do I need to achieve a certain amplitude resolution.
  • So storing the outputs in a usefull manner is also important
I choose to use a post sim function to reduce outputs.

Productos


Versión

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by