필터 지우기
필터 지우기

Is there a way to generate a wave that keeps a constant frequency, but varies the amplitude every wave?

조회 수: 1 (최근 30일)

답변 (1개)

Walter Roberson
Walter Roberson 2022년 1월 7일
Is it possible?
Fs = 4000;
F = 20;
T = 5;
t = (0:(T*Fs-1))/Fs;
x = sin(2*pi*t*F);
x2 = x;
x2(1:end/2) = x2(1:end/2) / 3;
plot(t, x, 'DisplayName', 'original');
hold on
plot(t, x2, 'DisplayName', 'modulated');
hold off
legend show
sound(x, Fs)
sound(0*x(1:floor(end/3)), Fs); %some silence
sound(x2, Fs)
xfft = fft(x);
x2fft = fft(x2);
L = length(x);
F = (0:L/2)/L * Fs;
nF = length(F);
y = abs(xfft(1:nF)); y(1) = 0; y = y./max(y);
y2 = abs(x2fft(1:nF)); y2(1) = 0; y2 = y2./max(y2);
skip = floor(nF/20);
subplot(2,1,1); plot(F(skip:end), y(skip:end), 'DisplayName', 'original'); title('original scaled')
subplot(2,1,2); plot(F(skip:end), y2(skip:end), 'DisplayName', 'modulated'); title('modulated scaled')
The answer, then, is NO:
If you modify the amplitude differently for two different points, then you modify the frequency.
  댓글 수: 1
Austin Bollinger
Austin Bollinger 2022년 1월 7일
Thank you for your in depth review. I am trying to program a 6 degree of freedom device to stay at 0.2hz in heave motion but vary the amplitude so the distance of the movement in heave varies. I'll have to think around this.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by