
基于MATLAB的连续性信号的采样与重构
对于一个连续性周期函数如cos(a*pi*t)+sin(b*pi*t),如何利用matlab实现它的采样与重构,希望大家给出重构公式以及matlab中具体的程序做法。...
对于一个连续性周期函数如cos(a*pi*t)+sin(b*pi*t),如何利用matlab实现它的采样与重构,希望大家给出重构公式以及matlab中具体的程序做法。
展开
1个回答
展开全部
程度如下:
% --- 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_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%set(handles.a,'String','');
%set(handles.b,'String','');
axes(handles.axes1);
cla reset;
axes(handles.axes2);
cla reset;
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cai2;
delete(handles.figure1);
% --------------------------------------------------------------------
function cai1_Callback(hObject, eventdata, handles)
% hObject handle to cai1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function cai2_Callback(hObject, eventdata, handles)
% hObject handle to cai2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- 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_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%set(handles.a,'String','');
%set(handles.b,'String','');
axes(handles.axes1);
cla reset;
axes(handles.axes2);
cla reset;
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
cai2;
delete(handles.figure1);
% --------------------------------------------------------------------
function cai1_Callback(hObject, eventdata, handles)
% hObject handle to cai1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function cai2_Callback(hObject, eventdata, handles)
% hObject handle to cai2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?

2025-08-07 广告
广州赛恩科学仪器有限公司(原中大科仪)始创于2001年,是全球领先的精密测量仪器供应商和微弱信号检测方案提供商。公司以锁相放大器为核心产品,陆续推出光学斩波器、源表、功率放大器、电化学工作站、电流源等一系列产品。赛恩科仪推出的锁相放大器,覆...
点击进入详情页
本回答由赛恩科仪提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询