필터 지우기
필터 지우기

How to recnstruct a signal from given discrete values ?

조회 수: 2 (최근 30일)
Furqan Haider
Furqan Haider 2013년 2월 19일
I have discrete values given in an array "xn". I wish to reconstruct the signal using sinc function (i.e. interpolation), but unable to achieve the target. small code is given as:
xn=[-0.0284 0.1123 0.1029 -0.0439 -0.1321 -0.0438 0.1030 0.1122 -0.0285 -0.1311 -0.0586 0.0922 0.1198 -0.0127 -0.1282 -0.0725 0.0801 0.1257 0.0034 -0.1234 -0.0854 0.0668 0.1297 0.0194 -0.1168 -0.0969];
% sin generation
%xn = A*sin(omega*n+theta);
n=0:25;
figure(1);
% plot
plot(n, xn, '-ro', 'LineWidth', 2,'MarkerEdgeColor', 'b', 'MarkerFaceColor', 'r', 'MarkerSize',6);
title('A*sin(omega*n+theta)');
n1 = 0:length(xn)-1;
figure(2)
subplot(3,1,1);
stem(n1,xn,'r','linewidth',2); % Plotting samples separately
title('Samples');
xlabel('Time Axis','fontsize',8);
ylabel('Amplitude');
axis([0 length(xn) -0.15 0.15]);

채택된 답변

José-Luis
José-Luis 2013년 2월 19일
I am not sure I understand the problem. It sounds to me that you need to find out the values of theta, omega and alpha. That is a curve fitting problem.
y=[-0.0284 0.1123 0.1029 -0.0439 -0.1321 -0.0438 0.1030 0.1122 -0.0285 -0.1311 -0.0586 0.0922 0.1198 -0.0127 -0.1282 -0.0725 0.0801 0.1257 0.0034 -0.1234 -0.0854 0.0668 0.1297 0.0194 -0.1168 -0.0969]';
x = (0:25)';
your_fit = fit(x,y,'sin1')
  댓글 수: 1
Furqan Haider
Furqan Haider 2013년 2월 20일
Thanks alot friend, yes thats exactly what i required. Thank u again.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by