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

2 次查看(过去 30 天)
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!

采纳的回答

Andy L
Andy L 2014-8-7
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 个评论
Jorge
Jorge 2014-8-8
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?
Andy L
Andy L 2014-8-8
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.

请先登录,再进行评论。

更多回答(1 个)

Jorge
Jorge 2014-8-8
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 个评论
Jorge
Jorge 2014-8-12
编辑:Jorge 2014-8-12
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?
Andy L
Andy L 2014-8-12
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?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Spectral Measurements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by