• 大小: 2KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-06-17
  • 语言: Matlab
  • 标签: matlab  

资源简介

光谱读入、降噪和去背景一体化matlab 源码,可用于拉曼等多光谱处理。

资源截图

代码片段和文件信息

clear;clc;
dir=‘D:\m\‘;%%%%%%%%%% 输入文件所在目录
%%%%%%%%%% read the signal of background.
fname=‘background-15mw-500um-10s.txt‘;%输入文件名
filename=strcat(dirfname);%%%%%%%%%% 构成文件路径
fid=fopen(filename‘r‘);
num=fscanf(fid‘%f %f‘[2inf]);
fclose(fid);
bg_y=num(2:);bg_x=num(1:); %backgroud后的信号
subplot(411);plot(bg_xbg_y‘b‘);grid;;%画出原始信号波形,同时画四个
title(‘backgroud signal‘);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fname=‘glu-15mw-500um-10s-2.txt‘;%the filename of nacl
filename=strcat(dirfname);
fid=fopen(filename‘r‘);
num=fscanf(fid‘%f %f‘[2inf]);
fclose(fid);
NL_y=num(2:);NL_x=num(1:); %nacl信号
%NL_y=num(2:)-mean(num(23110:3189));NL_x=num(1:); %去直流分量的nacl信号
subplot(412);plot(NL_xNL_y‘r‘);grid;;%画出nacl原始信号波形
title(‘glue signal‘);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%% use wav

评论

共有 条评论