首页 > 编程语言 >数字信号处理之展示 z 变换与 s 变换之间的所有关系 +matlab 源码

数字信号处理之展示 z 变换与 s 变换之间的所有关系 +matlab 源码

时间:2024-06-20 10:56:39浏览次数:12  
标签:10 变换 gui handles untitled1 hObject 源码 matlab

题目分析:

要求z变换与s变换的关系,首先考虑z变换与s变换之间运用领域的不同,s域是连续时间表示域,使用连续的时间变量s表示信号的自变量,取值范围为复平面上的所有点。而z域是离散时间表示域,使用离散的时间变量z表示信号的 自变量取值范围虽然也为复平面上的所有点,但对于离散信号而言,主要在单位圆内取值。

另外,从s域到z域的变换关系是通过采样操作实现的,具体关系如下:

  1. 采样操作:将连续时间信号进行采样,得到离散时间信号。采样操作可以用冲激函数序列来表示,即将连续时间信号乘以冲激函数序列。
  2. 傅里叶变换:对连续时间信号进行傅里叶变换,得到信号在频域上的表示,即s域表示。
  3. Z变换:对离散时间信号进行z变换,得到信号在频域上的表示,即z域表示。

设计思路:

首先设置一个列表框,列出输入信号,这里我设置了一个阶跃信号一个冲激信号,之后设置一个按钮与五个轴,在第一个轴中运用heaviside与stem

函数画出离散的阶跃函数,然后在第二个轴中用ztrans函数进行z变换,在第三个轴中用laplace函数进行拉普拉斯变换,随后再定义两个轴用于存放各自变换的定义域,从图中可以看到z变换的收敛域是在单位圆内,而s变换的收敛域是在y轴左边,这是因为对于离散时间系统来说,系统的稳定性要求系统函数的极点位于单位圆内,而对于连续时间系统来说,系统的稳定性要求系统函数的极点位于s平面的左半部分,因此收敛域通常位于轴线的左侧。

而z变换与s变换间数值关系经过推导可知s变换与z变换间关系:z=e^sT

界面设计结果

代码实现

function varargout = untitled1(varargin)
% UNTITLED1 MATLAB code for untitled1.fig
%      UNTITLED1, by itself, creates a new UNTITLED1 or raises the existing
%      singleton*.
%
%      H = UNTITLED1 returns the handle to a new UNTITLED1 or the handle to
%      the existing singleton*.
%
%      UNTITLED1('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in UNTITLED1.M with the given input arguments.
%
%      UNTITLED1('Property','Value',...) creates a new UNTITLED1 or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before untitled1_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to untitled1_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
 
% Edit the above text to modify the response to help untitled1
 
% Last Modified by GUIDE v2.5 05-Jun-2024 19:33:04
 
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @untitled1_OpeningFcn, ...
                   'gui_OutputFcn',  @untitled1_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 untitled1 is made visible.
function untitled1_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 untitled1 (see VARARGIN)
 
% Choose default command line output for untitled1
handles.output = hObject;
 
% Update handles structure
guidata(hObject, handles);
 
% UIWAIT makes untitled1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
 
 
% --- Outputs from this function are returned to the command line.
function varargout = untitled1_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
varargout{1} = handles.output;
 
 
% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
 
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu1
 
 
% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end
 
 
% --- 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=get(handles.popupmenu1,'Value');
syms z;
syms n;
syms t;
switch a
    case 1
        axes(handles.axes1);
        cla;
        a= -10:10;
        A =heaviside(a);
        stem(a, A);
        xlabel('n');
        ylabel('A');
        title('½×Ô¾º¯Êý');
        ylim([0, 2]);
        yticks(0:1:2); 
        xticks(-10:1:10); 
        
        
        axes(handles.axes2);
        cla
        n = sym('n', 'positive');
        A_z=ztrans(heaviside(n))
        fplot(A_z);
        title('½×Ô¾º¯ÊýµÄz±ä»»');
       ylim([-5, 5]);
       xlim([-5,5]);
        yticks(-5:1:5); 
        xticks(-5:1:5);
        yline(0, 'k--');
        
        
        axes(handles.axes3);
        cla
        f=heaviside(t);
        F = laplace(f)
        fplot(F);
        title('½×Ô¾º¯ÊýµÄs±ä»»');
       ylim([-5, 5]);
       xlim([-5,5]);
        yticks(-5:1:5);
        xticks(-5:1:5);
        yline(0, 'k--');
        
        axes(handles.axes4);
        cla
theta = linspace(0, 2*pi, 1000);
x_circle = cos(theta);
y_circle = sin(theta);
fill(x_circle, y_circle, 'b', 'FaceAlpha', 0.3);
hold on;
plot(x_circle, y_circle, 'b', 'LineWidth', 2);
xlabel('ʵÖá');
ylabel('ÐéÖá');
title('z±ä»»µÄÊÕÁ²Óò');
axis([-3, 3, -3, 3]);
axis equal;
grid on;
hold off;
 
axes(handles.axes5);
cla
x_axis = -10:0.1:10;
y_axis = zeros(size(x_axis));
plot(x_axis, y_axis, 'k', 'LineWidth', 2);
hold on;
fill([-10,-10,0, 0], [-10, 10, 10, -10], 'r', 'FaceAlpha', 0.3);
xlabel('x');
ylabel('y');
title('s±ä»»µÄÊÕÁ²Óò');
axis([-10, 10, -10, 10]);
grid on;
hold off;
case 2
    axes(handles.axes1);
    cla;
x = -10:1:10;
y = zeros(size(x));
y(x == 0) = 1;
 
stem(x, y);
xlabel('x');
ylabel('y');
ylim([-1,2])
title('³å¼¤º¯Êý');
grid on;
    axes(handles.axes2);
    cla;
     x=-5:1:5;
    y=ones(size(x));
    plot(x,y)
    axes(handles.axes3);
    cla;
    x=-5:1:5;
    y=ones(size(x));
    plot(x,y)
    axes(handles.axes4);
    cla;
    
    axes(handles.axes5);
    cla;
    
end
 
 
% --- Executes during object creation, after setting all properties.
function axes3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to axes3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called
 
% Hint: place code in OpeningFcn to populate axes3
 

标签:10,变换,gui,handles,untitled1,hObject,源码,matlab
From: https://blog.csdn.net/mohen_777/article/details/139766305

相关文章

  • 基于小程序056大学生心理健康测试系统微信小程序项目(源码+文档+运行视频+讲解视频)
    前言......
  • 43、基于神经网络拟合函数的体脂估计(matlab)
    1、神经网络拟合函数的原理及流程神经网络拟合函数是一种基于人工神经元之间相互连接的模型,用来拟合复杂的非线性函数关系。其原理是通过多层次的神经元网络,每一层神经元通过激活函数将输入信号加权求和后输出,经过多次迭代优化权值,使得网络输出与实际值误差最小化。流程如下:......
  • 一种基于非线性滤波过程的旋转机械故障诊断方法(MATLAB)
    在众多的旋转机械故障诊断方法中,包络分析,又称为共振解调技术,是目前应用最为成功的方法之一。首先,对激励引起的共振频带进行带通滤波,然后对滤波信号进行包络谱分析,通过识别包络谱中的故障相关的特征频率,从而判断是否发生故障与故障的类型。然而,包络分析方法的主要难点在于共振频......
  • Java项目-基于SpringCloud+springboot+vue的分布式架构网上商城系统(源码+数据库+文档
    源码获取:https://download.csdn.net/download/u011832806/89440647基于SpringCloud+SpringBoot+Vue的分布式架构网上商城系统   开发语言:Java   数据库:MySQL   技术:SpringCloud+SpringBoot+MyBatis+Vue.js+eureka   工具:IDEA/Ecilpse、Navicat、Maven经......
  • Java项目-基于ssm+vue的大学生兼职跟踪系统(源码+数据库+文档)​
    如需完整项目,请私信博主基于ssm+Vue的大学生兼职跟踪系统开发语言:Java数据库:MySQL技术:Spring+SpringMVC+MyBatis+Vue.js工具:IDEA/Ecilpse、Navicat、Maven本文以Java为开发技术,实现了一个大学生兼职跟踪系统。大学生兼职跟踪系统的主要实现功能包括:管理员:首页、个人中心、商......
  • Java项目-基于springboot+vue的学习平台(源码+数据库+文档)​
    源码获取:https://download.csdn.net/download/u011832806/89456223基于SpringBoot+Vue的学习平台开发语言:Java数据库:MySQL技术:SpringBoot+MyBatis+Vue.js工具:IDEA/Ecilpse、Navicat、Maven在Internet高速发展的今天,我们生活的各个领域都涉及到计算机的应用,其中包括学习平台......
  • 基于Java+Vue前后端分离在线考试系统(源码+LW+PPT+部署教程)
    博主介绍:✌全网粉丝10W+平台特邀作者、博客专家、CSDN新星计划导师、java领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于毕业项目实战✌一、作品包含源码+数据库+设计文档LW+PPT+全套环境和工具资源+部署教程二、项目技术前端技术:Ht......
  • 基于SpringBoot的在线刷题小程序的设计与实现+附源码+数据库
     摘要:随着互联网技术的快速发展,在线教育平台逐渐成为学生学习和复习的重要工具。为了提高用户在学习过程中的效率和体验,本文提出并实现了一个基于SpringBoot的刷题小程序。该小程序旨在通过高效的题库管理、智能化的刷题功能以及友好的用户界面,帮助用户更好地进行知识点的......
  • 鸿蒙内核源码分析(内存汇编篇) | 谁是虚拟内存实现的基础
    ARM-CP15协处理器ARM处理器使用协处理器15(CP15)的寄存器来控制cache、TCM和存储器管理。CP15的寄存器只能被MRC和MCR(MovetoCoprocessorfromARMRegister)指令访问,包含16个32位的寄存器,其编号为0~15。本篇重点讲解其中的C7,C2,C13三个寄存器。先拆解一段汇编代码上来......
  • 鸿蒙内核源码分析(并发并行篇) | 听过无数遍的两个概念
    理解并发概念并发(Concurrent):多个线程在单个核心运行,同一时间只能一个线程运行,内核不停切换线程,看起来像同时运行,实际上是线程被高速的切换.通俗好理解的比喻就是高速单行道,单行道指的是CPU的核数,跑的车就是线程(任务),进程就是管理车的公司,一个公司可以有很多台车.并发......