How o you work the phase difference between the input and the output of a sine wave?

6 ビュー (過去 30 日間)
Tianchu Lu
Tianchu Lu 2020 年 11 月 27 日
回答済み: Alan Moses 2020 年 12 月 2 日
Here is my code:
n = 0:49; % These are the time indices
input = 7*cos(2*pi*0.125*n+pi/3);
input_a = 2*input;
input_b = 8*cos(2*pi*0.25*n);
input_c = input_a + input_b;
b = [5, -5]; % The filter coefficients
y = conv(b,input); % The output signal
y_a = conv(b,input_a);
y_b = conv(b,input_b);
y_c = conv(b,input_c);
subplot(2,2,1);
plot(input, 'b*-'); % Plot the input as a blue line
hold on;
plot(y, 'r.-'); % Plot the output as a red line
hold on;
xlabel('Time'); % Label x axis
ylabel('Amplitude'); % Label y axis
subplot(2,2,2);
plot(input_a, 'b*-'); % Plot the input as a blue line
hold on;
plot(y_a, 'r.-'); % Plot the output as a red line
hold on;
xlabel('Time'); % Label x axis
ylabel('Amplitude'); % Label y axis
subplot(2,2,3);
plot(input_b, 'b*-'); % Plot the input as a blue line
hold on;
plot(y_b, 'r.-'); % Plot the output as a red line
hold on;
xlabel('Time'); % Label x axis
ylabel('Amplitude'); % Label y axis
subplot(2,2,4);
plot(input_c, 'b*-'); % Plot the input as a blue line
hold on;
plot(y_c, 'r.-'); % Plot the output as a red line
hold on;
xlabel('Time'); % Label x axis
ylabel('Amplitude'); % Label y axis
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
How do i work the phase difference between the output of y_b to the input and the phase difference of y_c to the input.

採用された回答

Alan Moses
Alan Moses 2020 年 12 月 2 日
You may refer to this link posted in the answer to a similar question here.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by