Fundamental of power spectral density PSD?

,How can specifying the Fundamental?can I take mean value? How can I specifying all other harmonic in this signal ,first ,second harmonic and so on? for this code ?
Fs = 150;
t = 0:1/Fs:1;
x = cos(2*pi*10*t);
%filter from DC component
x=x';
Sig2=x;
w333 =kaiser(151,3.5); %windowing by kaiser window
Sig2 = Sig2.*w333;
SigDFT = fft(Sig2,512);
SigDFT = SigDFT(1:257);
plot(abs(SigDFT))
plot(Sig2); grid on;

 Akzeptierte Antwort

Wayne King
Wayne King am 28 Dez. 2013

1 Stimme

Are these two peaks harmonically related? In other words, is the second peak an integer multiple of the first peak. In that case, it is customary to call the lower frequency peak the fundamental and subsequent integer multiples of that peak are the higher harmonics.

5 Kommentare

I Cant specifying the integer multiple of the first peak.
this is my signal
3.8146e-041
0
3.8146e-041
1.4694e-040
3.1031e-040
5.0431e-040
7.0083e-040
8.7193e-040
9.9406e-040
1.0515e-039
1.0382e-039
9.5875e-040
8.2645e-040
6.6109e-040
4.8522e-040
3.2032e-040
1.8336e-040
8.4424e-041
2.5678e-041
1.9459e-042
2.6691e-042
1.4857e-041
2.6436e-041
2.9314e-041
2.1538e-041
8.0719e-042
7.3562e-045
1.2288e-041
6.0353e-041
1.5632e-040
3.0543e-040
5.036e-040
7.3648e-040
9.805e-040
1.2059e-039
1.3811e-039
1.4783e-039
1.4784e-039
1.3756e-039
1.1795e-039
9.1544e-040
6.2128e-040
3.4266e-040
1.2602e-040
1.108e-041
2.3862e-041
1.7145e-040
4.3955e-040
7.9336e-040
1.182e-039
1.5459e-039
1.8259e-039
1.9736e-039
1.9598e-039
1.781e-039
1.4619e-039
1.0533e-039
6.2639e-040
2.6201e-040
3.8794e-041
2.0223e-041
2.4335e-040
7.1097e-040
1.3886e-039
2.2073e-039
3.0716e-039
3.8726e-039
4.5034e-039
4.8753e-039
4.9317e-039
4.6586e-039
4.0878e-039
3.2942e-039
2.3858e-039
1.4887e-039
7.2831e-040
2.0997e-040
2.4836e-042
1.2645e-040
5.5004e-040
1.193e-039
1.9384e-039
2.6515e-039
3.2012e-039
3.4831e-039
3.4383e-039
3.0662e-039
2.4279e-039
1.6405e-039
8.6047e-040
2.6051e-040
1.9282e-042
2.0685e-040
9.3499e-040
2.1688e-039
3.81e-039
5.6882e-039
7.5823e-039
9.2503e-039
1.0465e-038
1.1048e-038
1.0901e-038
1.0025e-038
8.5252e-039
6.5985e-039
4.5112e-039
2.5607e-039
1.0319e-039
1.5361e-040
6.1579e-041
7.7409e-040
2.1849e-039
4.0754e-039
6.1448e-039
8.0553e-039
9.4847e-039
1.018e-038
1.0003e-038
8.9596e-039
7.206e-039
5.0362e-039
2.8419e-039
1.0558e-039
8.5261e-041
2.4457e-040
1.698e-039
4.4219e-039
8.1945e-039
1.2615e-038
1.7152e-038
2.1215e-038
2.4242e-038
2.5785e-038
2.5583e-038
2.3617e-038
2.0121e-038
1.5567e-038
1.0599e-038
5.9471e-039
2.3206e-039
2.9485e-040
2.165e-040
2.1377e-039
5.793e-039
1.0626e-038
1.5866e-038
2.0637e-038
2.4106e-038
2.5618e-038
2.4827e-038
2.1779e-038
1.6943e-038
1.1171e-038
5.597e-039
1.479e-039
4.7851e-042
2.0903e-039
8.2007e-039
1.8224e-038
3.1424e-038
4.6481e-038
6.1636e-038
7.4907e-038
8.4378e-038
8.8492e-038
8.6341e-038
7.7875e-038
6.4015e-038
4.6637e-038
2.8413e-038
1.2519e-038
2.2426e-039
5.4143e-040
9.5931e-039
3.0418e-038
6.2626e-038
1.0433e-037
1.5226e-037
2.0206e-037
2.4878e-037
2.8747e-037
3.1378e-037
3.2458e-037
3.184e-037
2.9571e-037
2.589e-037
2.1203e-037
1.603e-037
1.0939e-037
6.464e-038
3.0252e-038
8.6859e-039
2.4492e-040
3.0256e-039
1.3243e-038
2.5927e-038
3.5931e-038
3.9132e-038
3.3652e-038
2.0938e-038
6.4906e-039
8.4548e-041
1.5369e-038
6.8798e-038
1.7793e-037
3.5922e-037
6.2555e-037
9.837e-037
1.4322e-036
1.9596e-036
2.5442e-036
3.154e-036
3.7488e-036
4.283e-036
4.7095e-036
4.9844e-036
5.0723e-036
4.9507e-036
4.6144e-036
4.0788e-036
3.3808e-036
2.5786e-036
1.7491e-036
9.8345e-037
3.8096e-037
4.1658e-038
5.8418e-038
5.0898e-037
1.4488e-036
2.9056e-036
4.8753e-036
7.3209e-036
1.0174e-035
1.3339e-035
1.6697e-035
2.0116e-035
2.346e-035
2.6595e-035
2.9401e-035
3.1778e-035
3.3652e-035
3.498e-035
3.5746e-035
3.5969e-035
3.5691e-035
3.4978e-035
3.3911e-035
3.258e-035
3.1078e-035
2.9497e-035
2.7921e-035
2.6424e-035
2.5066e-035
2.3898e-035
2.2955e-035
2.2265e-035
2.1844e-035
2.1703e-035
2.1844e-035
2.2265e-035
2.2955e-035
2.3898e-035
2.5066e-035
2.6424e-035
2.7921e-035
2.9497e-035
3.1078e-035
3.258e-035
3.3911e-035
3.4978e-035
3.5691e-035
3.5969e-035
3.5746e-035
3.498e-035
3.3652e-035
3.1778e-035
2.9401e-035
2.6595e-035
2.346e-035
2.0116e-035
1.6697e-035
1.3339e-035
1.0174e-035
7.3209e-036
4.8753e-036
2.9056e-036
1.4488e-036
5.0898e-037
5.8418e-038
4.1658e-038
3.8096e-037
9.8345e-037
1.7491e-036
2.5786e-036
3.3808e-036
4.0788e-036
4.6144e-036
4.9507e-036
5.0723e-036
4.9844e-036
4.7095e-036
4.283e-036
3.7488e-036
3.154e-036
2.5442e-036
1.9596e-036
1.4322e-036
9.837e-037
6.2555e-037
3.5922e-037
1.7793e-037
6.8798e-038
1.5369e-038
8.4548e-041
6.4906e-039
2.0938e-038
3.3652e-038
3.9132e-038
3.5931e-038
2.5927e-038
1.3243e-038
3.0256e-039
2.4492e-040
8.6859e-039
3.0252e-038
6.464e-038
1.0939e-037
1.603e-037
2.1203e-037
2.589e-037
2.9571e-037
3.184e-037
3.2458e-037
3.1378e-037
2.8747e-037
2.4878e-037
2.0206e-037
1.5226e-037
1.0433e-037
6.2626e-038
3.0418e-038
9.5931e-039
5.4143e-040
2.2426e-039
1.2519e-038
2.8413e-038
4.6637e-038
6.4015e-038
7.7875e-038
8.6341e-038
8.8492e-038
8.4378e-038
7.4907e-038
6.1636e-038
4.6481e-038
3.1424e-038
1.8224e-038
8.2007e-039
2.0903e-039
4.7851e-042
1.479e-039
5.597e-039
1.1171e-038
1.6943e-038
2.1779e-038
2.4827e-038
2.5618e-038
2.4106e-038
2.0637e-038
1.5866e-038
1.0626e-038
5.793e-039
2.1377e-039
2.165e-040
2.9485e-040
2.3206e-039
5.9471e-039
1.0599e-038
1.5567e-038
2.0121e-038
2.3617e-038
2.5583e-038
2.5785e-038
2.4242e-038
2.1215e-038
1.7152e-038
1.2615e-038
8.1945e-039
4.4219e-039
1.698e-039
2.4457e-040
8.5261e-041
1.0558e-039
2.8419e-039
5.0362e-039
7.206e-039
8.9596e-039
1.0003e-038
1.018e-038
9.4847e-039
8.0553e-039
6.1448e-039
4.0754e-039
2.1849e-039
7.7409e-040
6.1579e-041
1.5361e-040
1.0319e-039
2.5607e-039
4.5112e-039
6.5985e-039
8.5252e-039
1.0025e-038
1.0901e-038
1.1048e-038
1.0465e-038
9.2503e-039
7.5823e-039
5.6882e-039
3.81e-039
2.1688e-039
9.3499e-040
2.0685e-040
1.9282e-042
2.6051e-040
8.6047e-040
1.6405e-039
2.4279e-039
3.0662e-039
3.4383e-039
3.4831e-039
3.2012e-039
2.6515e-039
1.9384e-039
1.193e-039
5.5004e-040
1.2645e-040
2.4836e-042
2.0997e-040
7.2831e-040
1.4887e-039
2.3858e-039
3.2942e-039
4.0878e-039
4.6586e-039
4.9317e-039
4.8753e-039
4.5034e-039
3.8726e-039
3.0716e-039
2.2073e-039
1.3886e-039
7.1097e-040
2.4335e-040
2.0223e-041
3.8794e-041
2.6201e-040
6.2639e-040
1.0533e-039
1.4619e-039
1.781e-039
1.9598e-039
1.9736e-039
1.8259e-039
1.5459e-039
1.182e-039
7.9336e-040
4.3955e-040
1.7145e-040
2.3862e-041
1.108e-041
1.2602e-040
3.4266e-040
6.2128e-040
9.1544e-040
1.1795e-039
1.3756e-039
1.4784e-039
1.4783e-039
1.3811e-039
1.2059e-039
9.805e-040
7.3648e-040
5.036e-040
3.0543e-040
1.5632e-040
6.0353e-041
1.2288e-041
7.3562e-045
8.0719e-042
2.1538e-041
2.9314e-041
2.6436e-041
1.4857e-041
2.6691e-042
1.9459e-042
2.5678e-041
8.4424e-041
1.8336e-040
3.2032e-040
4.8522e-040
6.6109e-040
8.2645e-040
9.5875e-040
1.0382e-039
1.0515e-039
9.9406e-040
8.7193e-040
7.0083e-040
5.0431e-040
3.1031e-040
1.4694e-040
Wayne King
Wayne King am 28 Dez. 2013
Is this the signal in the time domain or is it the PSD estimate?
Mary Jon
Mary Jon am 28 Dez. 2013
Bearbeitet: Mary Jon am 28 Dez. 2013
it is the PSD estimate? after take fft
Wayne King
Wayne King am 28 Dez. 2013
And I need to know how you obtained that PSD estimate. In other words, what is the sampling frequency of the time data, show the MATLAB code you used, without that information nobody knows what the physical frequencies are.
Mary Jon
Mary Jon am 28 Dez. 2013
Bearbeitet: Mary Jon am 28 Dez. 2013
this is code
%c1 particle size=2hy,2hx---d=1hy---tc=4-----permittivity=4
c1=[3.4579e-016 3.455e-016 3.4588e-016 3.4646e-016 3.4707e-016 3.4754e-016 3.4788e-016 3.4811e-016 3.4828e-016 3.4837e-016 3.4836e-016 3.4818e-016 3.4783e-016 3.4744e-016 3.4715e-016 3.4701e-016 3.4701e-016 3.4715e-016 3.4744e-016 3.4783e-016 3.4818e-016 3.4836e-016 3.4837e-016 3.4828e-016 3.4811e-016 3.4788e-016 3.4754e-016 3.4707e-016 3.4646e-016 3.4588e-016 3.455e-016 3.4579e-016];
A=sum(c1);
AVE1=A/32;
w=c1-AVE1; %filter from DC component
w=w'
Sig2=w;
w333 =kaiser(32,3.5); %windowing by kaiser window
Sig2 = Sig2.*w333;
SigDFT2 = abs(fft(Sig2,512).^2); %FFT &PSD
SigDFT33=circshift(SigDFT2 ,size(SigDFT2 ,1)/2+1)
plot(SigDFT33);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Wayne King
Wayne King am 28 Dez. 2013
Bearbeitet: Wayne King am 28 Dez. 2013

1 Stimme

The answer is you are only seeing one peak in your signal. When you obtain a two-sided (negative and positive frequencies) PSD estimate of a real-valued signal, each real-valued sine wave results in two peaks (it is a sum or difference of two complex exponentials).
You can remove this redundancy by just retaining one side, which I show you how to do below.
A=sum(c1);
AVE1=A/32;
w=c1-AVE1; %filter from DC component
w=w';
Sig2=w;
w333 =kaiser(32,3.5); %windowing by kaiser window
Sig2 = Sig2.*w333;
SigDFT = fft(Sig2,512);
SigDFT = SigDFT(1:257);
plot(abs(SigDFT))
Now to determine the physical frequency corresponding to that peak, you must tell me what the sampling frequency or sampling interval is. For each pair of elements in your signal, cl, what is the separation between them in time or space?
You can clearly see just by plotting the "time" signal
plot(Sig2); grid on;
That the period is about 12 samples, but without knowing the difference between those samples, nobody can tell what that frequency is other than saying it's about 1 cycle per 12 samples.

5 Kommentare

Mary Jon
Mary Jon am 28 Dez. 2013
Mr.king, c1 signal have 32 value or elements at time=t1 I get c1(1), at time =t2 I get c1(2) ,at time=t3 I get c1(3) and so on ,I do not know sampling frequency really!!!
Wayne King
Wayne King am 28 Dez. 2013
Mary, If you don't know the physical separation between those signal values nobody can help you. All you can say is the frequency is about 1 cycle per 12 samples.
Mary Jon
Mary Jon am 28 Dez. 2013
ok ,suppose 1 cycle per 12 samples?How can specifying other harmonic in order to calculat total harmonic distortion?
Wayne King
Wayne King am 28 Dez. 2013
There really doesn't appear to be other harmonics present, but do you have the Signal Processing Toolbox? If so there is a function for that thd()
for this code ,how calculat the harmonic?
Fs = 150;
t = 0:1/Fs:1;
x = cos(2*pi*10*t);
%filter from DC component
x=x';
Sig2=x;
w333 =kaiser(151,3.5); %windowing by kaiser window
Sig2 = Sig2.*w333;
SigDFT = fft(Sig2,512);
SigDFT = SigDFT(1:257);
plot(abs(SigDFT))
plot(Sig2); grid on;

Melden Sie sich an, um zu kommentieren.

Wayne King
Wayne King am 29 Dez. 2013
Bearbeitet: Wayne King am 29 Dez. 2013

1 Stimme

There is only one sine wave in this signal. There are no harmonics.
Fs = 150;
t = 0:1/Fs:1;
x = cos(2*pi*10*t);
%filter from DC component
x=x';
Sig2=x;
w333 =kaiser(151,3.5); %windowing by kaiser window
Sig2 = Sig2.*w333;
NFFT = 512;
SigDFT = fft(Sig2,NFFT);
SigDFT = SigDFT(1:NFFT/2+1);
plot(abs(SigDFT))
To create a meaningful frequency vector.
df = Fs/NFFT;
freqvec = 0:df:Fs/2;
plot(freqvec,abs(SigDFT))
Now you see in the above plot that the peak is at 10 Hz. This is what I have been trying to tell you. You have to know the sampling frequency.

Produkte

Gefragt:

am 28 Dez. 2013

Bearbeitet:

am 29 Dez. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by