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

조회 수: 3 (최근 30일)
Jorge
Jorge 2014년 8월 7일
댓글: Andy L 2014년 8월 12일
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에서 Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by