登录
首页 » Others » FFT和IFFT的MATLAB实现代码

FFT和IFFT的MATLAB实现代码

于 2020-11-29 发布
0 263
下载积分: 1 下载次数: 2

代码说明:

快速傅里叶变换(FFT)和IFFT的MATLAB实现代码,编成了MATLAB函数形式,可以直接进行调用。便于大家学习研究。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 矩阵填充MATLAB代码
    经典的矩阵填充算法:包含:SVT. -- FPC---Lmafit---ALM----APG---SET---GROUSE---GRASTA--RMC--等;奉送2014-2016各个顶级会议有关MC的文献;
    2020-12-11下载
    积分:1
  • WPF写的获取外部公网IP地址及发送邮件的
    WPF写的获取外部公网IP地址及发送邮件的程序
    2020-12-08下载
    积分:1
  • 车载网络共享资源分配matlab
    随着5g的发展,越来越多的资源共享问题也成为了研究热点,描述了5g中车载网络的资源分配问题,
    2021-05-06下载
    积分:1
  • ST FOC 5.0说明书 快速入门 SDK v5.0.pdf
    ST FOC 5.0说明书 配合 开源库 https://download.csdn.net/download/hxinstar/10322042使用UM2374List of tablesList of tablesTable 1. List of acronymsTable 2Document revision history..23UM2374 Rey 13/24List of figuresUM2374List of figuresFigure 1. ST MC Workbench -Icon and installation folder treeFigure 2. ST MC Workbench-GUI expanded top viewFigure 3. ST Motor Profiler-GUI889Figure 5. ST Motor Profiler-SM-PMSM parameters exampleFigure 4. ST Motor Profiler- Hardware setup list examples1011Figure 6. ST Motor Profiler-l-PMSM parameters exampleFigure 7. ST Motor Profiler-Measurement results12Figure 8. ST Motor Profiler-Save window13Figure 9. ST MC Workbench - New Project window14Figure 10. ST MC Workbench -New Project Info window14Figure 11. ST MC Workbench -Project Settings15Figure 12. ST MC Workbench-Project Settings window.15Figure 13. ST MC Workbench -Project generation button16Figure 14. ST MC Workbench -Workspace selectionFigure 15. ST MC Workbench -Project generation build infoFigure19. ST MC Workbench- Use of the motor control and monitoring.∴、∴,"…,,∴…….17Figure 16. IDE-MC Project view example18Figure 17. STMC Workbench-Motor monitoring button.19Figure 18. ST MC Workbench -Motor monitoring GUI204/24UM2374 Rey 1/UM2374General informationGeneral informationThe Mc sDK is used for the development of motor-control applications running on STM3232-bit microcontrollers based on the arm Cortex-M processorTable 1 presents the definition of acronyms that are relevant for a better understanding ofthis documentTable 1. List of acronymsAcronymDescriptionGUIGraphical user interfaceIDEIntegrated development environmentFOCField-oriented controlFWFirmwareMotor controlMC WBMotor control Workbench(STMicroelectronics sw tool)MPMotor Profiler(STMicroelectronics software tool)PMSMPermanent-magnet synchronous motorPWMPulse-width modulationSDKSoftware development kitVCVector controlMore information about ST MC Workbench is provided in the stm32 motor control SDKv5.0toolsusermanual(um2380)availableatwww.st.comarmUM2374 Rey 15/24Motor control ecosystem setupUM23742Motor control ecosystem setupA suitable ST Motor Control ecosystem environment includesA PC running the needed Mc software toolsA third-party IDEa third-party ANSI C-compilerA JTAG/SWD interface for debugging and programmingAn STMicroelectronics application board with one of the STM32 microcontrollerssupported. It drives the power stage and featuresPWM outputs to gate driverADC channels to measure currentsDC bus voltageA three-phase PMsM motol· A power supplyRefer to the STM32 motor control software development kit(Mc sDk data brief(DB3548)atwww.st.comandtothereleasenoteformoredetails2.1Software tool setupThe STMicroelectronics motor-control ecosystem runs on a pc with Windows7The following Pc software tools are correctly installedST MC Workbench (v5.0.0 or later)STM32CubeMX(v4 24.0 or later)ST-LINK/2(v4.0.0 or later)Any supported IDEIAR Embedded Workbench@ for Arm(v7.80.4Keil MDK tools (v5.24.2 or later)Ac6 System Workbench(v2.3.0 or later)(a)Refer to the respective user manuals for proper installation. STMicroelectronics documentsareavailablefromtheinternetsiteatwwwst.comSTM32 motor control SDK v5.0 tools user manual (UM2380STM32 CubeMX for STM32 configuration and initialization c code generation usermanual (UM1718)STM32 ST-LINK utility software description user manual(UM0892)The AC6 tool framework is not supported in SDK v5.0 but in later versions6/24UM2374 Rey 1/UM2374Motor control ecosystem setup22Hardware setupThe connection of the STMicroelectronics application board to the pc requires a USBType-A connector. Refer to the description of the application board for details on the USBcableA dedicated description card is delivered with each STMicroelectronics application board forproper installation For more details, refer to the user manual of the board available atwww.st.comThe selected hardware can be one of the three setups· The complete MC KitOne of the complete inverter boardsAny STM32 evaluation board combined with one of the ST evaluation power stagesthat include the mc connectorUM2374 Rey 17/24Getting StartedUM23743Getting StartedWarning: Check that the board is correctly configured for the motorcontrol application and supplied with the expected inputvoltageNoteRefer to the user manual of the related hardware to setup the correct configuration, voltagerange, serial communication capabilities, and programming/debugging interface3.1Hardware connectionConnect a uSb cable between the pc and the stmicroelectronics application board andthe JTAG/SWD programming cable if it is different from the USB cable3.2Motor profilingLaunch the ST MC Workbench software tool either byclicking on its iconrunning it directly from the installation folder treeBoth ways of launching the ST MC Workbench are illustrated in Figure 1Figure 1. ST MC Workbench- Icon and installation folder treeI STMicroelectrorics感FOC SDKLv.3.0MotorControlv500WorkBenchST Motor Control Workbenchd ST Motor profileren the st motor profiler tool either byUsing its dedicated button in the St Mc Workbench GUl as illustrated in Figure 2Running it directly from the installation folder tree as illustrated in Figure 1Figure 2. ST MC Workbench-GUl expanded top viewFile Tools Help Documet ta ionNew ProjectLoad Project4 About HelpMotor ProfilRcGert ProJEcts己tdbrsDRpower board8/24UM2374 Rey 1/UM2374Getting StartedClick on the Select Boards button to display the list of supported boards as shown onFigure 3 and select the STMicroelectronics application board setup. Figure 4 on page 10presents examples from this listNoteThe ST Motor Profiler tool may be used only with ST hardware in the list of supportedsetups.Figure 3. ST Motor Profiler-GUI2 ST Motor Profile.l:e augmentedMotor ProfilersPole pairsPe row to detecbeed and Current /mitsMaκSpet1600FPMn7 Select Board∧pk02530pkMagnetic: SM-PMSN○-NSMMechanIcal mode lO CenElectrical modelOW000UM2374 Rey 19/24Getting StartedUM2374Figure 4. ST Motor Profiler-Hardware setup list examplesE ST Motor ProfiY Hideabsolete boarde arch Control board by narSe arch power boac bv nareControl boardower BoardxCancelHide boards with warningNUCLEO-F302R8X-NUCLEO-HMOTM1 3shNUCLEO-F302R8X-NUCLEO-HMOBM1 3shT2F302R8T6L6230PDSTM32F302R8T6STL22ON6FT●Acf8m:m3SELNRV2 Emiol connectorC Product Web PageG Product Web PageC Product Web PageC Product Web PageNUCLEO-F303RESTEVAL-IPMO5F 3ShNUCLEO.F303RESTEVAL-IPM108 3sh●Aiv命Ativ● Ac livSn Ngor ombreI connectorST-LINKV2C Product Web PageC Product Web PageC Product Web PageC Product Web PageClick on the sTmicroelectronics hardware setup to select it and configure the st motorProfiler toolAs an example, Figure 4 shows the selection of the P-NUCLEO-IHM001 motor controlNucleo pack with NucLEo-F302R8 and X-NUCLEO-IHMO7M1After hardware setup selection, fill in the parameter fields with the motor informationThe number of pole pairs of the motor(mandatory fieldThe Max Speed of the motor(optional field)by default, the st Motor Profiler tool searches for the maximum allowed speedmatching the motor and the hardware setup usedThe Max Current allowed by the motor(optional field)By default, it is the maximum peak current deliverable by the hardware setupThe nominal dC bus voltage used by the hardware setup(optional field)By default, it is the power supply stage as either the bus voltage for low voltageapplications(DC voltage), or the RMs value for high voltage application(Ac voltage)The magnetic built-in type(mandatory field)By default, the SM-PMSM is selectedThe Ld/Lq ratio(mandatory field only when l-PMSM built-in is selected as shown inFigure 6 on page 1110/24UM2374 Rey 1/
    2020-11-29下载
    积分:1
  • DEA分析软件MYDEA1.0
    一款功能强大的DEA分析软件,内置300多种DEA分析模型。
    2020-06-29下载
    积分:1
  • iOS开发
    iOS开发
    2013-12-10下载
    积分:1
  • LDA线性判别分析人脸识别MATLAB代码/ORL库
    原创,测试识别率0.99,重构图像完全比不上PCA,但能满足分类要求。可下载后直接运行,并保存特征向量数据
    2021-05-06下载
    积分:1
  • PWM电机调速原理及51单片机PWM序经典
    大家一起看看,希望对大家有用!PWM电机调速原理及51单片机PWM程序经典
    2020-12-10下载
    积分:1
  • VINS论文推倒及代码解析
    VINS 的功能模块可包括五个部分:数据预处理、初始化、后端非线性优化、闭环检测及闭环优化。代码中主要开启了四个线程,分别是:前端图像跟踪、后端非线性优化(其中初始化和 IMU 预积分在这个线程中)、闭环检测、闭环优化。、总体框架Measurement PreprocessingInitializationCamera(30hz)Feature Detectionnd rackerVisual-lnertialInitializedis- onlySfMAlignmentIMU (100hMU Pre-integrationLocal Visual-Inertial: OldestSliting WindowNewestNonli+、 Keyframe?OptimizationBundle Adjustment II Loop detectionwith RelocalizationStates from Loop ClosureFealure retrievel oop Deleted二二1---11------22===Global Pose Graph4-DoF Pose Graph OptimizationKeyframe DatabaseOptimization图1VINS框架ⅵINS的玏能模块可包括五个部分:数据预处理、初始化、后端非线性优化、闭环检测及闭环优化。代码中主要开启了四个线稈,分别是:前端图像跟踪、后端非线性伉化(其中初始化和IMU预积分在这个线程中)、闭环检测、闭环优化各个功能模块的作用上要有:1.I图像和MU预处理●图像:提取图像 Harris角点,利用金字塔光流跟踪相邻帧,通过 RANSAC去除异常点,最后将跟踪到的特征点push到图像队列中,并通知后端进行处理●IU:将IMU数据进行积分,得到当前时刻的位置、速度和旋转(PVQ),同时计算在后端优化中将用到的相邻帧的预积分增量,及预积分误差的 Jacobian矩阵和协方差项。1.2初始化首先,利用SFM进行纯视觉佔计滑窗內所有帧的位姿及3D点逆深度,最后与IMU预积分进行对齐求解初始化参数1.3后端滑窗优化将视觉约束、IMU约束和闭环约束放在·个大的目标函数中进行非线性优化,求解滑窗内所有帧的PVQ、bias等。L M States in the sliding windowIMU:k States from loop clos1Camera:冷 MU measurements>visual measurements★ Catur图2滑窗优化示意图14闭环检测和优化利用D)BoW进行闭环检测,当检测成功后进行重定位,最后对整个相机轨迹进行闭环优化。U预积分VisionIMUVision图3MU预积分示意图21当前时刻pVQ的连续形式将第k唢和第kl帧之间的所有IMU进行积分,可得第kHI帧的位置、速度和旋转(PVQ),作为视觉估计的初始值,这里的旋转采用的四元数。v△t+k+1∈[k,k+1]rW(at-ba ) -owletbk JtE[k, k+1]n(,-bdt∈[k,k+1]其中,a2和O为ⅠMU测量的加速度和角速度,是在Body自身坐标系, world坐标系是IMU所在的惯导系,上式的旋转公式推导可参考附录10.1。22当前时刻PVQ的中值法离散形式公式(1)给出的是连续吋刻的相机当前PVR的达代公式,为了跟代码致,下面给出基于中值法的公式,这与 Estimator:; processIMg(O函数中的Ps]、Rs]和Vs是一致的,IMU积分出来的第j时刻的物理量可以作为第j帧图像的初始值。tr t+a26t(2)ka,St其中q(a1-ba)-g"+q:+1(a+1-ba)(a;+o;+1)2.3两帧之间PVQ增量的连续形式通过观察公式(1)可知,IvU的预积分需要依赖与第k帧的ν和R,当我们在后端进行非线性优化时,需要迭代更新第κ唢的ν和R,这将导致我们需要根据每次迭代后值重新进行积分,这将非常耗吋。因此,我们考虑将优化变量从第k帧到第κ+1帧的IU预积分项中分离开来,通过对公式(1)左右两侧各乘Rb,可化简为:R(+p2k-=2△)+ak+1b其中DtElk, k+1t∈[k,k+1R k(at-bar)ldt)Wendtt∈[kk+1这样我们就得到了连续时刻的MU预积分公式,可以发现,上式得到的MU预积分的值只与不同时刻的a2和o相关。这里我们需要重新讨论下公式(5)预积分公式,以ab,为例,我们发现它是与MU的bias相关的,而bias也是我们需要优化的变量,这将导致的问题是,当每次迭代时,我们得到一个新的bias,又得根据公式(巧5)重新对第k帧和第k+1帧之间的IMU预积分,非常耗时。这里假设预积分的变化量与bias是线性关系,可以写成:ab,+/6n6ba+/16b+8 8ba +p(6)k+1sb24两帧之间PVQ增量的欧拉法离散形式面给出离散时刻的IMU预积分公式,首先按照论文中采用的欧拉法,给出第i个MU时刻与第i1个IMU时刻的变量关系为b+1k+的6t+元R(P)(1+R(P")(a2-bbn)δt25两帧之间PⅤQ增量的中值法离散形式卜面给出代码中采用的基」中值法的IMU预积分公式,这与 Estimator: processIMUO函数中的 Integration Base: push backo上是一致的。注意这里跟公式(2)是不一样的,这里积分出来的是前后两顿之间的IU增量信息,而公式(2)给出的当前帧时刻的物理量信息+1+B k St +=a, &tbb+1Bi + au1其中a,=slqilai-bai)+qiDi t aitl2.6连续形式下PVQ增量的误差、协方差及 JacobianIMU在每个吋刻积分出来的值是有误差的,下面我们对误差进行分析。首先我们直接给出在t时刻误差项的导数为:sa00016a000000-82(066hkR;0006|=00-(a-bh)0-1192k|+|000|mLL000016ba00101n000018b000F+ozk+ Gt其中:F25×15,G215×2,62x1,n12×,上式推导可参考附录102。下面我们讨论它的作用,将其可以简写为:6之k=F62z+Gtnt根据导数定义可知:62b=1m24-6262+8=62+628t=(+F6t)6z+(Gt6t)nt(11)这里我们对公式(1)的IMU误差运动方程再说明,将上式和EKF对比可知,上式恰好给出了如EKF一般对非线性系统线性化的过程,这里的意义是表示下一个时刻的IMU测量误差与上一个时刻的成线性关系,这样我们根据当前时刻的值,可以预测出下一个时刻的均值和协方差,而公式(1)给出的是均值预测,协方差预测公式如下Pb+6=(1+Ft)P(+Fl6t)7+(G,t)Q(G18t)ot(12)上式给出了协方差的选代公式,初始值Pk=0。其中,Q为表示噪声项的对角协方差矩阵000003000另外根据(11)式可获得诀差项的 Jacobian的迭代公式:(I+F26t)(14)其中 Jacobian的初始值为bk=12.7离散形式的PVQ增量误差分析我们首先直接给出PVQ增量误差在离散形式下的矩阵形式,为了与代码一致,我们修改下变量顺序,这和代码中 midPointIntegration(函数是一致的。(但不知为何计算的V中与前四个噪声项相关的差个负号?)1t fo660f106t‖loeBk+1=0f211f20016bδb0[6b102001rnot000kRkotk+1(15006t0n0000δt其中,推导可参考附录10.3:stE(ak-ba)02-4B+1(kk+121k+1b.)6t|6t2(Rr+ rk+18t2Stn=71=Rk+1(a+1-b)6tWr+ wf1=Ik+11+Gb。)δt-Rn+1(ak+121=-2配+1Stl st21(RK+Ruts)4rula1RrotstStR+1(a1R,+114/+11t28离散形式的PVQ增量误差的 Jacobian和协方差将公式(15)简写为:k+1F15×158215×1+V15×13Q则 Jacobian的迭代公式为k+15×15=F/k(16)其中, Jacobian的初始值为/k=l。这里计算出来的k+1只是为了给后面提供对bias的acoblar。协方差的迭代公式为P+15×15=FPFr+vQv(17)其中,初始值P=0。Q为表示噪声项的对角协方差矩阵:00000000aa000Q18×180a00(18)000000三、后端非线性优化31状态向量状态向量共包括滑动窗口内的n+l1个所有相机的状态(包括位置、朝向、速度、加速度计bias和陀螺仪bias)、 Camera到IMU的外参、m+1个3D点的逆深度X=[xr=pw,vb bpc,q3.2目标函数吗+(喻,2)+2(19)其中三个残差项即误差项分别为边缘化的先验信息、IMU测量残差、视觉的重投影残差。三种残差都是用马氏距离表示。根据《十四讲》中高斯牛顿法,若要计算目标函数的最小值,可以理解为,当优化变量有一个增量后,目标函数值最小,以IU残差为例,可写成如下所示:nin lre2bk, X+8Xrk x)+HSⅩDk+1oXk+1k+1其中HB,为B关于 XIK Jacobian,将上式展开并令关于6X的导数为0,可得增量δx的计算公式:H k 8X=k+1TB那么,公式(28)可写成+∑+∑Tk∑1rc上式中,B为MU预积分噪声项的协方差,P为vual观测的噪声协方差。当MU的噪声协方差P越大时,其信息矩阵Pk,将越小,意味着该MU观测越不可信,换句话说,因MU噪声较大,越不可信IMU预积分数据,而更加相信 visual观测。注意,这里的IMU和vsua协方差的绝对值没有意义,因为考虑得是两者的相对性可将上式继续简化为:(Ap+AB +Acox=bp +bB +bc其中,Ap,AB和Ac为 Hessian矩阵,上述方程称之为增量方程。33MU约束1)残差:两帧之间的PVQ和bias的变化量的差△tx+k+1bk qbk+1bR+1 xyz+g"△t)-Bk(20)sbbbb其中各增量关于bias的 Jacobian可从公式(16)的大 Jacobian中的相应位置获得。上面与代码中 Integration base: evaluateD对应,2)优化变量pb, 0W, Svb ,8ba:,bor Opb,, 80W ,Swb,, bakr, Sba3)Jacobian:计算 Jacobian时,残差对应求偏导对象分别为p6e,6vB,6h,ba],6b,6b
    2020-12-07下载
    积分:1
  • mppt原理图
    非常精典的一款mppt原理图,提供给开发者进行研究,探讨
    2021-05-07下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载