Frequency of combined waveform
10 次查看(过去 30 天)
显示 更早的评论
Dear all, I have two waves(one is wave load on the modal and other sinusoidal oscillation of one boundary of the modal. I combined the waves in matlab with this code.
t = 0:1:100;
x = 1.949*sin(2*pi*0.08416*t+5.97219) + 2*sin(2*pi*0.1111*t);
plot(t,x);
I want to find the frequency of the combined waveform.
Data for the wave
- Wave 1) Amplitude = 1.949m , frequency = 0.5288 rad/sec, phase angle = 5.97219
- Wave 2) Amplitude = 2m frequency = 0.69813 rad/sec, phase angle = 0
Thanks
0 个评论
采纳的回答
Wayne King
2013-2-4
There is no way to define a single frequency for this waveform. The waveform is the superposition of 2 frequencies, 0.08416 cycles\second (sample) and 0.1111 cycles\second (sample).
4 个评论
Image Analyst
2013-2-4
0.08416 and 0.1111 are rational numbers because they're finite. Their periods are 1/0.08416 = 11.8821292775665 and 1/0.1111 = 9.000900090009, so in a distance of 106.949858483947 you'd have about 11.88 cycles of wave #1 and 9 cycles of wave #2, and the pattern would repeat again, right?
But I agree with you it's not like you can combine two monochromatic waves and get a new monochromatic wave at a different frequency. If you consider it in the Fourier domain, each wave just gives a delta function (a dot) - they don't combine to give another dot in a different location (at a new frequency).
Normally one would not say that the period (frequency) of the "pattern repeat" is some new fundamental frequency of a combined waveform. If you play your tuba at the same time as I play my piccolo, we don't suddenly sound like a clarinet.
更多回答(1 个)
Miroslav Balda
2013-2-4
It is not clear what you want to find. However, the next code finds all parameters of the combined wave, i.e. amplitudes, frequencies and phases of a signal composed out of 2 sinewaves:
|
% Azzi
%%%%%%% 4.2.2013
clc
clear all
close all
global p0 x t
N = 100;
T = 1;
T1 = N*T;
t = (0:N-1)*T;
x = 1.949*sin(2*pi*0.08416*t+5.97219) + sin(2*pi*0.1111*t);
df = 1/T1;
f = (0:N-1)*df;
pL = {'FontSize',12,'FontWeight','bold'}; % label font properties
pT = {'FontSize',14,'FontWeight','bold'}; % title font properties
h1 = fig(1); % www.mathworks.com/matlabcentral/fileexchange/9035
plot(t,x); hold on; grid;
xlabel('t [s]',pL{:})
ylabel('fun(t)',pL{:})
title('fun(t) = sum of two sines',pT{:})
% Find initial estimates of parameters:
X = fft(x)*T; % approximation of FT
aX = abs(X);
L = extr(aX); % www.mathworks.com/matlabcentral/fileexchange/10272
Xp = aX(L{1}); % peaks
fp = f(L{1}); % frequency at peaks
h2 = fig(2);
plot(f,aX, f(L{1}),Xp,'or'); hold on; grid;
xlabel('f [Hz]',pL{:})
ylabel('modulus of fft(fun(t))',pL{:})
title('fft(fun(t))',pT{:})
p0 = zeros(6,1); % Find vector of initial estimates:
p0(1:2) = fp(1:2)'; % frequencies at peaks
p0(3:4) = 2*Xp(1:2)'/N; % rough amplitude estimates
quota = imag(X(L{1}))./real(X(L{1}));
p0(5:6) = atan(quota(1:2))';% phases
% Solution of an overdetermined set of nonlinear equations
% LMFnlsq from www.mathworks.com/matlabcentral/fileexchange/17534
[p,ssq,cnt] = LMFnlsq(@resid,ones(size(p0)),'Display',-1);
fprintf('\n p0 p\n\n');
fprintf('%15.10f%15.10f\n', [p0, p.*p0]');
fun = resid(p)' + x;
figure(h1);
pause(1)
plot(t,fun,'--r')
The program applies three functions from FEX - fig for figure placement, extr for finding extremal values in a vector, and LMFnlsq for least squares solution of an overdetermined system of nonlinear equations by Levenberg-Marquardt method in Fletcher's modification.
The code is able to solve more general task then the given one - all frequencies, amplitudes and phases are assumed being unknowns. The solution p of the given problem has been found in 9 iterations starting from the initial estmates p0, which have been obtained applying FFT to given time series. The initial parameters p0 and the obtained solution p have been
| p0 p
0.0800000000 0.0841600000
0.1100000000 0.1111000000
1.4570270622 1.9489999990
0.7896867594 1.0000000004
-0.5751678654 -0.3109953111
-1.3988961788 0.0000000020|
Since the p parameters practically equal those from the formula for x, the original line and that with evaluated p coincide.
Sorry, if you need something else.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Continuous Waveforms 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!