电力仿真论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: pscad atp VIP会员
新来朋友

cyj-ATP

fy030509

yoonae

fengxian

luzhiyuan

节度使

szg0933

Iris

YANG

柔直小白

messiliu10

ywwy

18720669717

qq954646921

suoybing

EE_EDTA

zcx

wuzhixiang

chj

玉面孟尝

13647319986

晚风吻尽荷花叶

吃不胖的王胖子

荔荔

zjzy8888

查看: 731|回复: 7

MATLAB中FFT分析

[复制链接]
发表于 2020-10-14 10:10:55 | 显示全部楼层 |阅读模式

注册可看大图、可下载

您需要 登录 才可以下载或查看,没有账号?立即注册

x
首先我把外部的波形导入,进行编辑,总说我错误;
第二0.00005秒的数据间隔,我设fs=20000;
还是希望帮我把FFT搞出来,用的是花月先生的代码
V33.txt (5.91 MB, 下载次数: 12)



[幸运儿]: 923307293 发帖奖励金钱 5 幸运榜
回复

使用道具 举报

发表于 2020-10-14 18:50:22 | 显示全部楼层
[分享] MATLAB中做FFT
https://www.mmc-hvdc.com/t-497.html

2楼给出了详细的代码呀,是不是没有往下看。。。
一个兴趣广泛的灵魂
回复

使用道具 举报

发表于 2020-10-16 09:09:12 | 显示全部楼层
这数据处理过程是咋样的,应该得先提取需要进行傅里叶变换的数据吧
回复

使用道具 举报

 楼主| 发表于 2020-10-16 16:27:52 来自手机 | 显示全部楼层
123 发表于 2020-10-16 09:09
这数据处理过程是咋样的,应该得先提取需要进行傅里叶变换的数据吧

谢谢,我已经解决了
回复

使用道具 举报

会员网龄
3.8岁

TA在排名榜Top100

积分:暂未上榜

发帖:暂未上榜

在线:暂未上榜

  • TA的每日心情
    闭嘴
    2021-12-21 15:41
  • 5

    主题

    1

    回帖

    6

    积分

    新手上路

    Rank: 1

    积分
    6
    发表于 2020-10-19 15:49:11 | 显示全部楼层
    923307293 发表于 2020-10-16 16:27
    谢谢,我已经解决了

    请问是如何解决的
    回复

    使用道具 举报

     楼主| 发表于 2020-10-21 16:20:54 | 显示全部楼层
    1inxuetin 发表于 2020-10-19 15:49
    请问是如何解决的

    close all
    Fs = 10000;            % Sampling frequency                    
    T = 1/Fs;             % Sampling period      
    L = 5000;             % Length of signal
    t = (0:L-1)*T*1;        % Time vector
    S = VarName8;
    % Corrupt the signal with zero-mean white noise with a variance of 4.

    X = S(1:5000) + 2.*randn(length(t),1);

    % Plot the noisy signal in the time domain. It is difficult to identify the frequency components by looking at the signal X(t).
    figure(1);
    plot(1000*t,X)
    title('Signal Corrupted with Zero-Mean Random Noise')
    xlabel('t (milliseconds)')
    ylabel('X(t)')
    Y = fft(X);
    % Compute the two-sided spectrum P2. Then compute the single-sided spectrum P1 based on P2 and the even-valued signal length L.
    P2 = abs(Y/L);
    P1 = P2(1:L/2+1);
    P1(2:end-1) = 2*P1(2:end-1);
    % Define the frequency domain f and plot the single-sided amplitude spectrum P1.
    % The amplitudes are not exactly at 0.7 and 1, as expected, because of the added noise. On average,
    % longer signals produce better frequency approximations.
    figure(2);
    f = Fs*(0:(L/2))/L;
    plot(f,P1')
    title('Single-Sided Amplitude Spectrum of X(t)')
    xlabel('f (Hz)')
    ylabel('|P1(f)|')
    % Now, take the Fourier transform of the original, uncorrupted signal and retrieve the exact amplitudes, 0.7 and 1.0.
    %

    Y1 =  fft(S);
    P21 = abs(Y1/L);
    P11 = P2(1:L/2+1);
    P11(2:end-1) = 2*P11(2:end-1);

    figure(3);
    plot(f,P11')
    title('Single-Sided Amplitude Spectrum of S(t)')
    xlabel('f (Hz)')
    ylabel('|P1(f)|')



    这是代码,我之前其实是其他部分有问题,S后面是导入数据删掉第一行标题后的列数据
    回复

    使用道具 举报

    会员网龄
    3.7岁

    TA在排名榜Top100

    积分:暂未上榜

    发帖:暂未上榜

    在线:NO. 42 名

    该用户从未签到

    6

    主题

    11

    回帖

    64

    积分

    注册会员

    Rank: 3Rank: 3

    积分
    64
    发表于 2021-1-6 22:57:58 | 显示全部楼层
    您好,请问一下外部波形的导入是如何实现的
    回复

    使用道具 举报

     楼主| 发表于 2021-1-7 09:33:52 | 显示全部楼层
    wanghe 发表于 2021-1-6 22:57
    您好,请问一下外部波形的导入是如何实现的

    MATLAB主界面上方,主页----导入数据-----点击后右下角有可识别的数据文件---------选择所有文件---------找到所要导入的数据--------出现新界面------选择自己要导入的数据以及输出类型-------导入
    回复

    使用道具 举报

    发贴规则: 
    1.严禁将帖子发至无关版面,请选择对应版块发贴,以维护论坛的系统性和整洁性。
    2.提问题需要将问题描述清楚,涉及到仿真模型问题需要添加报错图片或描述,上传仿真模型效果更佳。
    3.由于论坛的时效性不足,可以发帖后点击楼层下分享到:QQ好友和群快速得到关注。
    4.保持和谐。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|手机版|小黑屋|电力仿真论坛

    GMT+8, 2024-5-15 09:29 , Processed in 0.121400 second(s), 60 queries .

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表