フィルターのクリア

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 Center および File ExchangeSmoothing and Denoising についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by