이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
How I can produce the integration of digital signal data without knowing the function?
조회 수: 51 (최근 30일)
이전 댓글 표시
SMY
2016년 6월 3일
Hello all,
I have 512 acceleration data points. I want to integrate the data points to get the velocity and then the displacement data points by using Trapezium and Sympson's rules.
Example of my data points: x = [0 0.002 0.0039 0.0059 0.0078 0.0098 0.0117]; time(s) y = [-0.5570 0.1310 0.4010 0.0722 -0.5210 -0.8090 -0.7230]; acceleration (m/s2)
The problems happened when I looked around MATLAB code needs a function. By I dont.
Please advice.
Thank you for your time.
Regards, SMY
채택된 답변
Star Strider
2016년 6월 3일
Use the cumtrapz function with your vector. It does not need a function.
댓글 수: 15
SMY
2016년 6월 3일
Thank you so much! The trapezium integration was working now. But how about the Simpson's rule? Did you have any idea on that?
Star Strider
2016년 6월 3일
My pleasure!
You would have to use the quad function for Simpson’s rule, or write your own code for it. The Wikipedia article on Simpson’s rule seems to me to have code you can adapt to use vectors.
SMY
2016년 6월 3일
Again.. thank you so much but unfortunately it seems difficult for me and I could not understand. :( However, thank you for your time and help.
Star Strider
2016년 6월 3일
My pleasure.
It is not terribly difficult, but since this sounds like homework, I’m reluctant to develop code and send it to you.
SMY
2016년 6월 5일
It not really homework to be honest. :) I am research student I really struggle with this coding since this not my area of research.
Star Strider
2016년 6월 5일
Since it’s research, I’ll provide as much help as I can.
The problem is that every description I can find for Simpson’s rule indicates that it is only used with functions. I could find no references to it being used to integrate data. The result you got with cumtrapz is likely the best result you can get with empirical data.
You could always do a function fit to it (for example, a polynomial using polyfit and polyint to integrate it), or preferably a non-linear function that describes the process that created your data (estimating the parameters of that model), then integrate that function (analytically if possible), or with Simpson’s rule (the quad function), or integral.
SMY
2016년 6월 5일
편집: Star Strider
2016년 6월 5일
Yes, I did it. I identified the best fit using polynomial quadrant.
What I found was when I used both quad and integral function the result will be the total of area under graph not the point instead. I also try quadv to find from 1 interval to another interval but it seems not right.
I found and currently try this -> http://uk.mathworks.com/matlabcentral/fileexchange/28726-simpson-s-rule-integration and really hope it can works.
Star Strider
2016년 6월 5일
I have to admit that I did not look in the File Exchange (that I usually check first), probably because cumtrapz does what you want. That author apparently made Simpson’s rule work for vectors.
I hope it works for you. Please post back here if there is a significant difference between the cumtrapz and the Simpson’s rule function results. (I would trust the cumtrapz result.)
SMY
2016년 6월 5일
For your information, my data is about signal processing. Yes, indeed. based on the theory the trapezium's rule better than simpson's rule and since I working with big frequency (Hz) therefore the trapezium will be better. But for my work, i need to check both for preparing myself when I presenting later.
I will let you know and share here. If not, it seems I give up. :D
Star Strider
2016년 6월 5일
Interesting. I do a lot of biomedical signal processing.
You’re integrating accelerometer signals, so I would begin by doing a Fourier transform on them (each of the ‘X’, ‘Y’ and ‘Z’ directions) to define the signal spectrum and the noise spectrum.. In my experience they are easily separable. Then design a bandpass filter to separate out the gravitational constant and the noise (my filter design procedure is here: How to design a lowpass filter for ocean wave data in Matlab? although there are several ways to design discrete filters in MATLAB), then do the integrations on the filtered signals. Filter design is inherently experimental with respect to particular signals, so it will require some experimentation to get the filter characteristic and signal result that you want. Use the same filter on all of the channels, since you have used all of the channels to design your filter.
It is always best to use the fft function to analyse your signals first. Then filter them to eliminate as much noise as possible without eliminating any of your signal energy spectrum, then do whatever other processing on the filtered signals that you want to.
SMY
2016년 6월 5일
Biomedical signal processing? Interesting. Mine is vibrational signal processing. My PhD is working in vibrations in steering wheel.
Thank you so much for the knowledge sharing. :)
Star Strider
2016년 6월 5일
As always, my pleasure!
Steering wheel vibrations can contribute to human workload, and therefore to fatigue, and lower situational awareness. This relates to the postural reflexes that tend to keep the steering wheel steady, and so compensate for position changes constantly. (Workload metrics and related areas were also an area of my research many years ago.) Yours is an important area of human workload research, even if you never considered it in that context. Similar problems are acoustic noise and undercarriage vibrations, for the same reasons.
SMY
2016년 6월 6일
I solved it!!
By referring to (https://youtu.be/364T-wFzBFM?list=PLgzRuzNES8Up4ib7hgo3O2y38LSQK138z)
From both trapezium and simpson's rules, from the graph it shows that simpson's rule was more clearly while trapezium bit compress maybe because simpson's rules are summations for 3 interval.
But for signal processing presentation, I will discuss further later with my supervisor.
But for now, to solve the integration by Simpson's rule, please refer to (https://youtu.be/364T-wFzBFM?list=PLgzRuzNES8Up4ib7hgo3O2y38LSQK138z)
Thank you Star Strider for your time!
Star Strider
2016년 6월 6일
Congratulations!
Thank you for the links. I will look at them.
As always, my pleasure!
farzad
2020년 4월 16일
dear Star, how do we check that we have not eliminated any energy from the signal by filtering it ? and is CWT the best option to filter ?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Acoustics, Noise and Vibration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)