- #1
doop4
- 4
- 0
Essentailly what I am interested is to solve Equation 10.25 in the following link
<http://books.google.co.uk/books?id=Hwb5D60vb5IC&pg=PA701&lpg=PA701&dq=%22mean+angular+frequency%22&source=bl&ots=dSH6fzeZNC&sig=GB5J8nwpLCIULGhAHZLAm0RxgLM&hl=en&ei=NubNSpKqO92NjAeqwKmHBA&sa=X&oi=book_result&ct=result&resnum=9#v=onepage&q=%22mean%20angular%20frequency%22&f=false>
ie. solve for the mean angular frequency. Let's call it x' where
x'=integral(x*y(x).dx)/integral(y(x).dx) % Equation 10.25 where y(x) is the spectral density and x is the angular frequency.
I have data for the spectral density values for a given angular frequency
y=[6.2770
10.5137
14.8385
19.2196
21.5972
19.6632
15.2690
10.9238
6.5569]
x=[ 2.6097
2.6158
2.6259
2.6314
2.6501
2.6615
2.6633
2.6654
2.6659]
How can I solve for x' using the above data in Matlab?
My understanding is that the numerator is essentially:
sum[x*y(x)] for the given values of x and y (ie a weighted form ). therefore I have
numerator=x.*y;
the bottom is the integral so i tried using the MATLAB function trapz(x,y) to calculate that as well.
denominator =trapz(x,y);
therefore x'=numerator/denominator
But the answer I get is incorrect. I am not sure where my mistake is. Any help will be much appreciated!
<http://books.google.co.uk/books?id=Hwb5D60vb5IC&pg=PA701&lpg=PA701&dq=%22mean+angular+frequency%22&source=bl&ots=dSH6fzeZNC&sig=GB5J8nwpLCIULGhAHZLAm0RxgLM&hl=en&ei=NubNSpKqO92NjAeqwKmHBA&sa=X&oi=book_result&ct=result&resnum=9#v=onepage&q=%22mean%20angular%20frequency%22&f=false>
ie. solve for the mean angular frequency. Let's call it x' where
x'=integral(x*y(x).dx)/integral(y(x).dx) % Equation 10.25 where y(x) is the spectral density and x is the angular frequency.
I have data for the spectral density values for a given angular frequency
y=[6.2770
10.5137
14.8385
19.2196
21.5972
19.6632
15.2690
10.9238
6.5569]
x=[ 2.6097
2.6158
2.6259
2.6314
2.6501
2.6615
2.6633
2.6654
2.6659]
How can I solve for x' using the above data in Matlab?
My understanding is that the numerator is essentially:
sum[x*y(x)] for the given values of x and y (ie a weighted form ). therefore I have
numerator=x.*y;
the bottom is the integral so i tried using the MATLAB function trapz(x,y) to calculate that as well.
denominator =trapz(x,y);
therefore x'=numerator/denominator
But the answer I get is incorrect. I am not sure where my mistake is. Any help will be much appreciated!