求采样保持的MATLAB程序

来源:百度知道 编辑:UC知道 时间:2024/06/16 10:08:05
快点啊 谢谢

[1]基于MATLAB的连续性信号的采样与重构
对于一个连续性周期函数如cos(a*pi*t)+sin(b*pi*t),如何利用matlab实现它的采样与重构,希望大家给出重构公式以及matlab中具体的程序做法。
提问者: Richardljl - 试用期 一级 最佳答案
程度如下:
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
a=str2double(get(handles.a,'String'));
b=str2double(get(handles.b,'String'));
t=0:0.01:10;
x=cos(a*pi*t)+sin(b*pi*t);
axes(handles.axes1);
plot(t,x);
xlabel('t'),ylabel('f1');
grid on;
y=fft(x);
f=(0:length(y)-1)'/length(y);
axes(handles.axes2);
plot(f,y);
xlabel('ω'),ylabel('F(ω)');
grid on;
end

% --- Executes on button press in pushbutton2.
function pushbutton2_Ca