how can I do an integration window of a signal both in MATLAB and Simulink?

Hi all,
I'm developing a Stochastic Knock Control and need to do an integration window of the in-cylinder pressure signal for a window of a 40 crank angle degrees. Any idea?
Also, I need to obtain the maximum amplitude of the signal within that integration window.
Many thanks!

 Réponse acceptée

Andy L
Andy L le 7 Août 2014
Hi Jorge.
Have you considered running your simulink model from a MATLAB function, using the function sim. You can set up your parameters in your function (make sure to write them in your simulink model too) and using to workspace blocks these will be passed back into the function workspace. You can then use these variables to plot onto a figure, find a max value etc.
I hope this helps.

5 commentaires

Thanks Andy,
I know what you mean, but I don't have to much experience in this software and don't know how to code that in MATLAB.
I saw you know about Powertrain and Systems Engineering. :)
The question is that I've got a signal from the in-cylinder pressure sensor. I need to apply a bandpass filter from 13 to 20kHz and obtain the maximum amplitude of an integration window, for instance from 0 degrees (TDC) to 40 degrees ATDC.
Andy L
Andy L le 7 Août 2014
Modifié(e) : Andy L le 7 Août 2014
Your welcome Jorge!
Is the cylinder pressure being modelled in simulink? Or is this a signal you have from test data? Do you need MATLAB/Simulink for modelling or simply for the signal processing?
I've got the in-cylinder pressure in a spreadsheet excel file and it's from test data. I need to process this signal and then it will be run in my Knock Control Model in MATLAB/Simulink. Is it answer your questions?
Yes - I would look to structure your project in the following way:
  1. Import the data from Excel into MATLAB - xlsread will help with this.
  2. Pre process your data using MATLAB to prepare it for your simulink model.
  3. Run your Simulink Model from MATLAB as mentioned above.
  4. Post-Process your model outputs that have been passed back into your MATLAB function.
  5. Any plotting saving etc can be done.

Connectez-vous pour commenter.

Plus de réponses (1)

Jorge
Jorge le 8 Août 2014
I wouldn't say it better :)
In that structure I don't know how to process the in-cylinder pressure signal to obtain the knock intensity.
I saw some example such as the use of an amplifier, bandpass, absolute value and integrator, but I don't know how to code that and if it is a good signal processing.
Have you got any idea?

3 commentaires

I would discuss this with the person that has tasked you with the job in terms of how you should define knock intensity. My guess is some form of transformation to the frequency domain - FFT is a good basic start but leaky.
You can then filter out your appropriate frequencies and determine your knock gains.
Some potentially useful documentation:
Jorge
Jorge le 12 Août 2014
Modifié(e) : Jorge le 12 Août 2014
I think FFT are slower in a real time simulation. I tried a bandpass filter and it seems that the signal is well filtered:
a=xlsread('Mini_With_Knock.xlsx','A2:A430')
b=xlsread('Mini_With_Knock.xlsx','B2:B430')
plot(a,b)
hold on
d = fdesign.bandpass('Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2',1e3,2e3,20e3,21e3,40,1,40,48e3);
Hd = design(d,'equiripple');
Hd.PersistentMemory = true; fvtool(Hd);
y = filter(Hd,b);
abs=abs(y)
max=max(abs) plot(a,y);
Unfortunately, in my University there is nobody who can help me with this. Indeed, I'm doing this project with a company and you can imagine how it works...they are always busy.
What do you mean with knock gains? Should I add gain to the signal response?
In Frequency domain the output (level) is typically gain (dB) vs Frequency - I'm assuming that specific frequencies above a specific gain threshold are how you are identifying knock?

Connectez-vous pour commenter.

Question posée :

le 7 Août 2014

Commenté :

le 12 Août 2014

Community Treasure Hunt

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

Start Hunting!

Translated by