matlab中如何对一组数据进行fft变换后得到频谱图??
3个回答
Sievers分析仪
2024-10-13 广告
2024-10-13 广告
是的。传统上,对于符合要求的内毒素检测,最终用户必须从标准内毒素库存瓶中构建至少一式两份三点标准曲线;必须有重复的阴性控制;每个样品和PPC必须一式两份。有了Sievers Eclipse内毒素检测仪,这些步骤可以通过使用预嵌入的内毒素标准...
点击进入详情页
本回答由Sievers分析仪提供
推荐于2017-11-25
展开全部
如何画一个信号的频谱今天终于搞明白了,这么简单的东西今天才明白如何快速的用matlab画出,真是惭愧。光啃书本知识,会做题目真的是不够的,以后我要多多注意如何实践!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
比如
clear;
clc;
t=0:0.001:2;
n=2001;
Fs=1000;
Fc=200;
x=cos(2*pi*Fc*t);
y1=fft(x);
y2=fftshift(y1);
f=(0:2000)*Fs/n-Fs/2;
hold on;
plot(f,abs(y1),'r')
plot(f,abs(y2),'b')
这里需要在做了2001点FFT后将0到2000映射到真正的频谱-fs/2到+fs/2上才能成为真正的频谱
又如
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% .正弦波定义
f1=50; % 频率1
f2=100; % 频率2
fs=2*(f1+f2); % 采样频率
Ts=1/fs; % 采样间隔
N=120; % 采样点数
n=1:N;
y=sin(2*pi*f1*n*Ts)+sin(2*pi*f2*n*Ts); % 正弦波混合
figure(1)
subplot(2,1,1)
plot(y);
title('Signal')
subplot(2,1,2)
f=(1:120)*fs/200-fs/2; %这里相当于做了120点FFT,需要把1:120映射到-fs/2到+fs/2
F=abs(fftshift(fft(y)));
stem(f,F);
title('Amplitude Spectrum')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
再比如:
clc;
clear all;
fs=500;
t=0:1/fs:1.5;
f1=40; f2=20;
x=sin(2*pi*t*f1)+sin(2*pi*t*f2); %input signal
figure(1);
plot(t,x);
title('input signal x[n]'); %input signal wave
figure(3);
f=(0:750)*fs/751-fs/2;
plot(f,abs(fftshift(fft(x)))); % plot input signal's frequency spectrum
title('frequency components of the input singal')
希望大家以后能快速的画出频谱!
http://bbs.matwav.com/viewthread.php?tid=482120
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
比如
clear;
clc;
t=0:0.001:2;
n=2001;
Fs=1000;
Fc=200;
x=cos(2*pi*Fc*t);
y1=fft(x);
y2=fftshift(y1);
f=(0:2000)*Fs/n-Fs/2;
hold on;
plot(f,abs(y1),'r')
plot(f,abs(y2),'b')
这里需要在做了2001点FFT后将0到2000映射到真正的频谱-fs/2到+fs/2上才能成为真正的频谱
又如
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% .正弦波定义
f1=50; % 频率1
f2=100; % 频率2
fs=2*(f1+f2); % 采样频率
Ts=1/fs; % 采样间隔
N=120; % 采样点数
n=1:N;
y=sin(2*pi*f1*n*Ts)+sin(2*pi*f2*n*Ts); % 正弦波混合
figure(1)
subplot(2,1,1)
plot(y);
title('Signal')
subplot(2,1,2)
f=(1:120)*fs/200-fs/2; %这里相当于做了120点FFT,需要把1:120映射到-fs/2到+fs/2
F=abs(fftshift(fft(y)));
stem(f,F);
title('Amplitude Spectrum')
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
再比如:
clc;
clear all;
fs=500;
t=0:1/fs:1.5;
f1=40; f2=20;
x=sin(2*pi*t*f1)+sin(2*pi*t*f2); %input signal
figure(1);
plot(t,x);
title('input signal x[n]'); %input signal wave
figure(3);
f=(0:750)*fs/751-fs/2;
plot(f,abs(fftshift(fft(x)))); % plot input signal's frequency spectrum
title('frequency components of the input singal')
希望大家以后能快速的画出频谱!
http://bbs.matwav.com/viewthread.php?tid=482120
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
将那个i输出线分0一t支q出来输入i到一b个kto file的模块就好了d,如果要转到EXECL中2的话将他们链接就好
e┳
e┳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询