基于AM的广播信号接收源码程序 - matlab通信信号 - 谷速源码
下载频道> 资源分类> matlab源码> 通信信号> 基于AM的广播信号接收源码程序

标题:基于AM的广播信号接收源码程序
分享到:

所属分类: 通信信号 资源类型:程序源码 文件大小: 745.83 KB 上传时间: 2016-01-24 22:22:42 下载次数: 3 资源积分:1分 提 供 者: matlab源码 基于AM的广播信号接收源码程序
内容:
基于AM的广播信号接收源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
部分代码如下:
function varargout = am_mod(varargin)
%Realizado por: Ing. Kelman Belloso.
% Edit the above text to modify the response to help am_mod
 
% Last Modified by GUIDE v2.5 15-Feb-2015 18:16:26
 
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @am_mod_OpeningFcn, ...
                   'gui_OutputFcn',  @am_mod_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end
 
if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
%**************************************************************************
 
 
%**************************************************************************
% --- Executes just before am_mod is made visible.
function am_mod_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to am_mod (see VARARGIN)
%set(gcf,'Color',[1 1 0]);
clc
format compact
format short g
warning('off','all')
%warning
%handles
%get(handles.fc,'String')
Image_load=imread('Logo1_UDB.jpg');
Img=image(Image_load,'Parent',handles.Axis1);
set(handles.Axis1,'Visible','off','Ydir','reverse',...
    'XLim',get(Img,'XData'),'YLim',get(Img,'YData'));
handles.mag=0.5;
set(handles.Freq_men,'Value',250);
set(handles.Freq_port,'Value',5000);
set(handles.fm,'String',250);
set(handles.fc,'String',5000);
%set(handles.fm,'String',125);
set(handles.Am_port,'Value',handles.mag);
set(handles.Am_men,'Value',handles.mag);
set(handles.Txt_Port2,'String',handles.mag);
set(handles.Txt_Men2,'String',handles.mag);
set(handles.slide_DC,'Value',handles.mag);
set(handles.Txt_Dc,'String',handles.mag);
handles.ejex=0:1/100000:.016;
handles.init=0;
%ao=analogoutput('winsound');
%handles.ao=ao;
Cadena=strcat('ao=analogoutput(''winsound'');','addchannel(ao, [1 2]);','ao.SampleRate=32000;',...
'f1=get(handles.Freq_men,''Value'');','Am1=get(handles.Am_men,''Value'');',...
't=linspace(0,pi/1024,16.375);','DC=get(handles.slide_DC,''Value'');',...
'set(handles.Txt_Dc,''String'',DC);','y_m=Am1*sin(f1*t)+DC;',...
'f2=get(handles.Freq_port,''Value'');','Am2=get(handles.Am_port,''Value'');',...
'y_c=Am2*sin(f2*t);','h1=get(handles.Rbtn_Mensaje,''Value'');',...
'h2=get(handles.Rbtn_Portadora,''Value'');','h3=get(handles.Rbtn_Modulacion,''Value'');',...
'if h1==1','y=y_m;','elseif h2==1','y=y_c;','else','y=y_m.*y_c;','end',...
'putdata(ao, [y'' y'']);','ao.RepeatOutput = 1;','ao.TriggerType = ''Immediate'';',...
'start(ao);','wait(ao,(ao.SampleRate/1000)*(ao.RepeatOutput+3));','stop(ao)',...
'delete(ao);');
%t=timer('Period',0.001,'ExecutionMode','fixedRate','BusyMode','drop',...
% 'TimerFcn',Cadena);
%t=timer('Period',0.001,'ExecutionMode','fixedRate','BusyMode','drop',...
% 'TimerFcn',{'Generar(hObject, eventdata, handles)'});
%handles.t=t;
%axes(handles.axes1)
%y_m=handles.mag*sin(2*pi*250*handles.ejex)+handles.mag;
%y_m=cos(2*pi*60*handles.ejex)+1;
%plot(handles.ejex,y_m,'--','Color',[1 0 0]);
%hold on;
%y_c=handles.mag*sin(2*pi*5000*handles.ejex);
%y_c=cos(2*pi*100*handles.ejex);
%y_am=y_m.*y_c;
%plot(handles.ejex,y_am)
%hold off;
%title('Se馻l AM');
%ylabel('Amplitud');
%xlabel('Tiempo (s)');
%axes(handles.axes2)
%grid on
%plotspec(y_am,1/10000);
%title('SPECTRO');
%zoom on
Graficar(hObject, eventdata, handles)
 
% Choose default command line output for am_mod
handles.output = hObject;
 
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes am_mod wait for user response (see UIRESUME)
% uiwait(handles.figure1);
 
%    'StartFcn',         @user_timer_start, ...              % start function
%    'StopFcn',          @user_timer_stop, ...               % stop function
timer_obj=timer(...
    'TimerFcn',         {@user_timer_update, hObject}, ...  % timer function, has to specific the handle to the GUI,
    'ExecutionMode',    'fixedRate', ...                    %
    'Period',           1, ...                           % updates every xx seconds
    'TasksToExecute',   inf, ...
    'BusyMode',         'drop');
% save the timer object as application data
setappdata(hObject,'timer_obj',timer_obj);                 % need to save it because we need to stop and delete it when quit
start(timer_obj);
%**************************************************************************
 
 
%**************************************************************************
% --- Outputs from this function are returned to the command line.
function varargout = am_mod_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Get default command line output from handles structure
handles.output=hObject;
varargout{1} = handles.output;
%**************************************************************************
 
 
%**************************************************************************
% --- Executes on slider movement.
function Freq_men_Callback(hObject, eventdata, handles)
% hObject    handle to Freq_men (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
%f_m=50*get(hObject,'Value');
%f_c=200*get(handles.Freq_port,'Value');
Graficar(hObject, eventdata, handles)
handles.output = hObject;
guidata(hObject, handles);
%**************************************************************************
 
 
%**************************************************************************
% --- Executes during object creation, after setting all properties.
function Freq_men_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Freq_men (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%**************************************************************************
 
 
%**************************************************************************
% --- Executes on slider movement.
function Freq_port_Callback(hObject, eventdata, handles)
% hObject    handle to Freq_port (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
%f_c=200*get(hObject,'Value');
%f_m=50*get(handles.Freq_men,'Value');
Graficar(hObject, eventdata, handles)
handles.output = hObject;
guidata(hObject, handles);
%**************************************************************************
 
 
%**************************************************************************
% --- Executes during object creation, after setting all properties.
function Freq_port_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Freq_port (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%**************************************************************************
 
 
%**************************************************************************
% --- Executes on slider movement.
function Am_men_Callback(hObject, eventdata, handles)
% hObject    handle to Am_men (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
Graficar(hObject, eventdata, handles)
handles.output = hObject;
guidata(hObject, handles);
%**************************************************************************
 
 
%**************************************************************************
% --- Executes during object creation, after setting all properties.
function Am_men_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Am_men (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%**************************************************************************
 
 
%**************************************************************************
% --- Executes on slider movement.
function Am_port_Callback(hObject, eventdata, handles)
% hObject    handle to Am_port (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
Graficar(hObject, eventdata, handles)
handles.output = hObject;
guidata(hObject, handles);
%**************************************************************************
 
 
%**************************************************************************
% --- Executes during object creation, after setting all properties.
function Am_port_CreateFcn(hObject, eventdata, handles)
% hObject    handle to Am_port (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%**************************************************************************
 
 
%**************************************************************************
% --- Executes on slider movement.
function slide_DC_Callback(hObject, eventdata, handles)
% hObject    handle to slide_DC (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
Graficar(hObject, eventdata, handles)
handles.output = hObject;
guidata(hObject, handles);
%**************************************************************************
 
 
%**************************************************************************
% --- Executes during object creation, after setting all properties.
function slide_DC_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slide_DC (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end
%**************************************************************************
 
 
%**************************************************************************
% --- Executes on button press in Btn_Cerrar.
function Btn_Cerrar_Callback(hObject, eventdata, handles)
% hObject    handle to Btn_Cerrar (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
%t=handles.t;
%delete(t)
close all;
warning('on','all');
%**************************************************************************
 
 
%**************************************************************************
function Mn_Info_Callback(hObject, eventdata, handles)
% hObject    handle to Mn_Info (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
Texto={'Sistemas de comunicaci髇 I','Modulaci髇 en Amplitud (AM)',...
    '','Autores:','1) Ing. Luis Kelman Belloso Huezo',...
    '2) Ing. Edward Alfonso Ar関alo Monge'}';
msgbox(Texto,'UDB-IIIE','help');
%**************************************************************************
 
 
%**************************************************************************
function Graficar(hObject, eventdata, handles)
%handles
%f_c=200*get(handles.Freq_port,'Value');
%f_m=50*get(handles.Freq_men,'Value');
%f_c=10000*get(handles.Freq_port,'Value');
f_c=get(handles.Freq_port,'Value');
%f_m=500*get(handles.Freq_men,'Value');
f_m=get(handles.Freq_men,'Value');
set(handles.fc,'String',f_c);
set(handles.fm,'String',f_m);
%V_port=handles.mag*get(handles.Am_port,'Value');
V_port=get(handles.Am_port,'Value');
%V_men=handles.mag*get(handles.Am_men,'Value');
V_men=get(handles.Am_men,'Value');
set(handles.Txt_Port2,'String',V_port);
set(handles.Txt_Men2,'String',V_men);
DC=get(handles.slide_DC,'Value');
set(handles.Txt_Dc,'String',DC);
axes(handles.axes1)
%y_m=(V_men/2)*cos(2*pi*f_m*handles.ejex)+DC;
y_m=V_men*cos(2*pi*f_m*handles.ejex)+DC;
plot(handles.ejex,y_m,'--','Color',[1 0 0]);
hold on;
grid on
y_c=V_port*cos(2*pi*f_c*handles.ejex);
y_am=y_m.*y_c;
plot(handles.ejex,y_am)
hold off;
title('Se馻l AM');
ylabel('Amplitud');
xlabel('Tiempo (s)');
axes(handles.axes2)
grid on
plotspec(y_am,1/1000)
title('Espectro');
%**************************************************************************
 
 
%**************************************************************************
% --- Executes when user attempts to close figure1.
function figure1_CloseRequestFcn(hObject, eventdata, handles)
% hObject    handle to figure1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Hint: delete(hObject) closes the figure
%stop(timerfind)
%delete(timerfind)
 
%stop(handles.ao)
%delete(handles.ao)
stop(getappdata(hObject, 'timer_obj')); 
%pause(0.5);
delete(getappdata(hObject, 'timer_obj'));
%delete(timerfind)
delete(hObject);
%**************************************************************************
 
 
%**************************************************************************
%function user_timer_start(src, evt)
%disp('Timer started!');
%**************************************************************************
 
 
%**************************************************************************
function user_timer_update(src,evt,fig_handle)
%function user_timer_update(src,evt,hObject)
handles = guihandles(fig_handle);
ao=analogoutput('winsound');
addchannel(ao, [1 2]);
ao.SampleRate = 32000;
f1=get(handles.Freq_men,'Value');
Am1=get(handles.Am_men,'Value');
t=linspace(0,4*pi,64000);
DC=get(handles.slide_DC,'Value');
set(handles.Txt_Dc,'String',DC);
y_m=Am1*sin(f1*t)+DC;
f2=get(handles.Freq_port,'Value');
Am2=get(handles.Am_port,'Value');
y_c=Am2*sin(f2*t);
h1=get(handles.Rbtn_Mensaje,'Value');           %Se馻l mensaje
h2=get(handles.Rbtn_Portadora,'Value');         %Se馻l portadora
h3=get(handles.Rbtn_Modulacion,'Value');        %Se馻l modulada
if h1 == 1
y=y_m;
elseif h2 ==1
y=y_c;
else
y=y_m.*y_c;
end
putdata(ao, [y' y_m']);
ao.RepeatOutput = 1;       %N鷐ero de veces a repetir el audio  
ao.TriggerType = 'Immediate';
%ao
start(ao);
wait(ao,(ao.SampleRate/1000)*(ao.RepeatOutput+3));
stop(ao);
delete(ao);
%set(handles.lbl_timeNow, 'string', datestr(now, 'yyyy-mm-dd HH:MM:SS'));
%**************************************************************************
 
 
%**************************************************************************
%function user_timer_stop(src, evt)
%disp('Timer stop!');
%**************************************************************************
 

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

基于AM的广播信号接收源码程序/
基于AM的广播信号接收源码程序/code/
基于AM的广播信号接收源码程序/code/AM_Board_Audio.png
基于AM的广播信号接收源码程序/code/Logo UDB.JPG
基于AM的广播信号接收源码程序/code/Logo1_UDB.jpg
基于AM的广播信号接收源码程序/code/SCO111_G2_Modulaci de Amplitud_Primera Parte.pdf
基于AM的广播信号接收源码程序/code/am_mod.asv
基于AM的广播信号接收源码程序/code/am_mod.fig
基于AM的广播信号接收源码程序/code/am_mod.m
基于AM的广播信号接收源码程序/code/license.txt
基于AM的广播信号接收源码程序/code/plotspec.m

关键词: 源码 信号 程序

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved