필터 지우기
필터 지우기

How to align multiple signals?

조회 수: 29 (최근 30일)
Susan
Susan 2023년 2월 7일
편집: Sulaymon Eshkabilov 2023년 2월 8일
Hi Matlab experts,
I'm trying to align these signals but have yet to be successful.
The signals are attached. They are periodic, noisy sin signals. I used the alignsignals function as well as xcorr to align the signals. Could somebody help me out with that?
Moreover, how can I compute the frequency of these signals?
Thanks in advance!

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 8일
Here is one of the viable solutions to compute resonant frequencies of each signal and find out if their are coherent:
S1 = load('s1.mat').s1;
S2 = load('s2.mat').s2;
S3 = load('s3.mat').s3;
S4 = load('s4.mat').s4;
S5 = load('s5.mat').s5;
S6 = load('s6.mat').s6;
fs = 1024;
S = [S1; S2; S3; S4; S5; S6];
N = length(S1);
freq = fs*(0:(N/2))/N; % Freq values
for ii=1:6
Y = fft(S(ii,:), N); % FFT of the signal s(t)
Yp = abs(Y/N); % Absolute value or magnitude of the signal spectrum
semilogy(freq,Yp(1:N/2+1), 'linewidth', 2)
hold all
end
title('FFT analysis of a signal')
xlabel('Frequency, [Hz]')
ylabel('Magnitude of signal = |S(f)|')
ylim([0, 0.025])
legend({'s1', 's2', 's3', 's4', 's5', 's6'})
grid on
You can check signal coherences using wcoherence() function:
wcoherence(S1,S2)
wcoherence(S2,S3)
wcoherence(S3,S4)
wcoherence(S4,S5)
wcoherence(S5,S6)
It looks like signal s5 and s6 are pure noise.
  댓글 수: 2
Susan
Susan 2023년 2월 8일
편집: Susan 2023년 2월 8일
@Sulaymon Eshkabilov Thank you so much for your response. I genuinely appreciate it.
Please tell me how I interpret the first figure's results regarding the relationship between the time domain signals.
I went through the wcoherence documentation but am still trying to figure out how to interpret the results. Any help on that would be greatly appreciated.
Finally, how should I do that if I want to align these signals in the time domain?
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 8일
편집: Sulaymon Eshkabilov 2023년 2월 8일
Most welcome. What do mean to align the signals in the time domain? Put them together or what? to make their peak values correspond?
You can try alignsignals() fcn:
[S2a, S3a] = alignsignals(S2, S3, [], "truncate");
nexttile
plot(S2), hold on
plot(S3)
nexttile
plot(S2a), hold on
plot(S3a)
hold off
See - DOC.

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

추가 답변 (1개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023년 2월 7일
One fundamental question for signal processing is a "must", that is "what is the data sampling time or sampling frequency?"
Pl., provide this info.
  댓글 수: 1
Susan
Susan 2023년 2월 7일
편집: Susan 2023년 2월 7일
@Sulaymon Eshkabilov Thanks for your response. The sampling rate of all signals equals 1024.

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

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by