精华内容
下载资源
问答
  • hslogic算法仿真-基于MATLAB的OFDM系统的仿真-for mc = 1:MC x = rand(1,nDSC)>0.5; xt = 2*x -1; xt = (nFFT/sqrt(nDSC))*ifft(fftshift(xt),nFFT); % else use 'measured' awgn xtt = [xt(end-nCP+1:end)...
  • MATLAB AWGN

    2021-01-28 19:25:33
    MATLAB AWGN y = awgn(x,SNR) :在信号x中加入高斯白噪声。信噪比SNR以dB为单位。x强度假定为0dBW。如果x是复数,就加入复噪声。 y = awgn(x,SNR,SIGPOWER) 如果SIGPOWER是数值,则其代表以dBW为单位信号强度;...

    MATLAB AWGN

    y = awgn(x,SNR) :在信号x中加入高斯白噪声。信噪比SNR以dB为单位。x的强度假定为0dBW。如果x是复数,就加入复噪声。
    y = awgn(x,SNR,SIGPOWER) 如果SIGPOWER是数值,则其代表以dBW为单位的信号强度;如果SIGPOWER为’measured’,则函数将在加入噪声之前测定信号强度。

    function y = awgn(varargin)

    %#codegen

    narginchk(2,5);

    % Validate signal input
    sig = varargin{1};
    validateattributes(sig, {‘numeric’}, …
    {‘nonempty’}, ‘awgn’, ‘signal input’);

    % Validate SNR input
    reqSNR = varargin{2};
    validateattributes(reqSNR, {‘numeric’}, …
    {‘real’,‘scalar’,‘nonempty’}, ‘awgn’, ‘SNR input’);

    % Validate signal power
    if nargin >= 3
    if strcmpi(varargin{3}, ‘measured’)
    sigPower = sum(abs(sig( : )).^2)/numel(sig); % linear
    else
    validateattributes(varargin{3}, {‘numeric’}, …
    {‘real’,‘scalar’,‘nonempty’}, ‘awgn’, ‘signal power input’);
    sigPower = varargin{3}; % linear or dB
    end
    else
    sigPower = 1; % linear, default
    end

    % Validate state or power type
    if nargin >= 4
    coder.internal.errorIf(comm.internal.utilities.isCharOrStringScalar(varargin{4}) && …
    all(~strcmpi(varargin{4}, {‘db’,‘linear’})), …
    ‘comm:awgn:InvalidPowerType’);

    isStream = ~isempty(varargin{4}) && ~comm.internal.utilities.isCharOrStringScalar(varargin{4});
    
    if isStream && ~isa(varargin{4}, 'RandStream') % Random stream seed
        validateattributes(varargin{4}, {'double'}, ...
            {'real','scalar','nonnegative','integer','<',2^32}, ...
            'awgn', 'seed input');
    end
    

    else % Default
    isStream = false;
    end

    % Validate power type
    if nargin == 5
    coder.internal.errorIf(comm.internal.utilities.isCharOrStringScalar(varargin{4}), … % Type has been specified as the 4th input
    ‘comm:awgn:InputAfterPowerType’);
    coder.internal.errorIf(all(~strcmpi(varargin{5}, {‘db’,‘linear’})), …
    ‘comm:awgn:InvalidPowerType’);
    end

    isLinearScale = ((nargin == 4) && ~isStream && strcmpi(varargin{4}, ‘linear’)) || …
    ((nargin == 5) && strcmpi(varargin{5}, ‘linear’));

    % Cross-validation
    coder.internal.errorIf(isLinearScale && (sigPower < 0), …
    ‘comm:awgn:InvalidSigPowerForLinearMode’);

    coder.internal.errorIf(isLinearScale && (reqSNR < 0), …
    ‘comm:awgn:InvalidSNRForLinearMode’);

    if ~isLinearScale % Convert signal power and SNR to linear scale
    if (nargin >= 3) && ~comm.internal.utilities.isCharOrStringScalar(varargin{3}) % User-specified signal power
    sigPower = 10^(sigPower/10);
    end
    reqSNR = 10^(reqSNR/10);
    end

    noisePower = sigPower/reqSNR;

    if isStream
    if isa(varargin{4}, ‘RandStream’)
    stream = varargin{4};
    elseif isempty(coder.target)
    stream = RandStream(‘shr3cong’, ‘Seed’, varargin{4});
    else
    stream = coder.internal.RandStream(‘shr3cong’, ‘Seed’, varargin{4});
    end

    if ~isreal(sig)
        noise = sqrt(noisePower/2)* (randn(stream, size(sig)) + ...
                                  1i*randn(stream, size(sig)));
    else
        noise = sqrt(noisePower)* randn(stream, size(sig));
    end
    

    else
    if ~isreal(sig)
    noise = sqrt(noisePower/2)
    (randn(size(sig)) + 1irandn(size(sig)));
    else
    noise = sqrt(noisePower)
    randn(size(sig));
    end
    *
    end

    y = sig + noise;

    所谓高斯白噪声(White Gaussian Noise)中的高斯是指概率分布是正态函数,而白噪声是指它的二阶矩不相关,一阶矩为常数,是指先后信号在时间上的相关性。高斯白噪声是分析信道加性噪声的理想模型,通信中的主要噪声源——热噪声就属于这类噪声。

    展开全文
  • i have some datas which are included some deflection and force ... Like deltaX deltaY and forces measured at that points as Fx and Fy. I want to create a colormap at that points with the magnitude...

    i have some datas which are included some deflection and force values. Like deltaX deltaY and forces measured at that points as Fx and Fy. I want to create a colormap at that points with the magnitude of forces and color transition between points in 2D. For example if point1 is red(high value, big deflection) and point2 is blue(low value, small deflection) i want color transition between them. Do you have any suggestion for that?

    Data are given below.

    First column positionX

    second column positionY

    third column forceX

    forth column forceY

    I need to plot this map according to X and Y positions and force magnitudes.

    ***When i take the magnitude of vectors we have positionX positionY and only 1 force value.

    filein =

    0 0 -0.0395 0.1189

    0 1.5053 0.2127 -11.3568

    -0.0008 3.0082 0.6719 -22.0470

    -0.0048 4.5093 0.9231 -32.7004

    0.0069 6.0033 1.2499 -43.2750

    -0.0029 7.5008 1.6960 -53.4941

    1.4981 0.0102 -1.5213 1.2031

    1.4979 1.5003 -1.2326 -10.0738

    1.5071 3.0043 -0.6965 -20.7386

    1.4896 4.4943 -0.2563 -31.5026

    1.5020 5.9921 0.0480 -42.3186

    1.5021 7.4909 0.7614 -52.7354

    3.0016 0.0022 -2.6099 1.9455

    3.0022 1.4960 -2.6157 -9.3388

    2.9959 3.0087 -1.8898 -20.1823

    2.9955 4.4977 -1.3670 -30.7842

    2.9923 6.0041 -0.8444 -41.7370

    2.9976 7.5055 -0.2241 -52.1361

    4.4995 -0.0016 -4.0576 2.5489

    4.5009 1.4961 -3.8135 -8.6871

    4.4930 2.9939 -3.0315 -19.4825

    4.4986 4.5045 -2.6034 -30.2974

    4.5046 5.9931 -1.9570 -40.9145

    4.4972 7.5023 -1.1994 -51.4071

    5.9931 -0.0014 -5.1986 3.2395

    5.9954 1.5000 -5.1224 -7.9289

    6.0017 2.9977 -4.3153 -18.7471

    6.0045 4.4939 -3.6613 -29.4662

    6.0030 6.0081 -2.9086 -40.3400

    6.0003 7.5006 -2.1704 -50.6973

    7.4974 -0.0018 -6.5690 4.0048

    7.4977 1.5043 -6.5230 -7.0994

    7.5047 3.0058 -5.5833 -18.0435

    7.5083 4.5058 -4.8070 -28.6861

    7.5024 6.0059 -4.0150 -39.4321

    7.5006 7.5023 -3.1837 -49.8617

    解决方案

    You can use meshgrid and surf or mesh command to plot it:

    [X,Y] = meshgrid(filein(:,1),filein(:,2));

    M = sqrt(filein(:,3).^2+filein(:,4).^2);

    Z=meshgrid(M,M);

    C = gradient(Z);

    figure

    surf(X,Y,Z,C);colorbar

    You can remove the mesh and interpolate as follows:

    surf(X, Y, Z,'EdgeColor', 'None', 'facecolor', 'interp');

    Then view it from above:

    view(2)

    展开全文
  • 各位大侠好,我是通信工程毕业,不过对通信原理理解不太升入,参考别人代码用matlab做了一个QPSK仿真。存在以下几点问题,希望大侠能解答: 1,已知fs,fc,数据码率下如何确定接收端带通滤波器带宽。 ...
  • 使用matlab进行语谱图绘制

    千次阅读 2019-01-14 23:03:03
    方法1:自带函数 R=512;%设置窗函数长度 window=hamming(R);%使用汉明窗 N=R;%短时傅立叶函数点数 L=200;%步长 overlap=R-L;%窗重叠点数 figure('visible','on... x= awgn(x,100,'measured','linear'); %加...

    方法1:自带函数

    
        R=512;%设置窗函数长度
        window=hamming(R);%使用汉明窗
        N=R;%短时傅立叶函数点数
        L=200;%步长
        overlap=R-L;%窗重叠点数
        figure('visible','on')
        figure(1)
        x= awgn(x,100,'measured','linear');  %加入高斯白噪声
        specgram(x(:,1),N,fs,window,overlap);%生成声谱图
        axis off;
        saveas(gcf,'faqing1','jpg');%如需直接产生大小固定的声谱图,需要使用该函数保存
    

     

    方法2:

         fn=size(y,2);                           %帧数
         freq=(0:wlen/2)*fs/wlen;                % 计算FFT后的频率刻度
         frameTime=(((1:fn)-1)*inc+wlen/2)/fs;   % 计算FFT后的时间刻度
         
         figure('visible','off')
         imagesc(frameTime,freq,20*log10(abs(y)+eps)); % 画出Y的图像
         set(gca,'xtick',[0:0.2:6])
         axis xy; 
         colormap(jet

     

    展开全文
  • matlab 求信噪比

    千次阅读 2019-11-12 23:08:39
    信噪比是衡量信号质量重要指标, 尤其是在比较滤波算法过程中 有着重要参考价值。 先看看维基百科定义: clear all;...Y = awgn(X,14,'measured'); %加入信噪比为10db噪声,加入前...

     信噪比是衡量信号质量的重要指标, 尤其是在比较滤波算法的过程中 有着重要的参考价值。

    先看看维基百科的定义:

    clear all;
    clc ;
    X= sqrt(2)*sin(0:pi/1000000:6*pi);              %产生正弦信号
    Y = awgn(X,14,'measured');                      %加入信噪比为10db的噪声,加入前预估信号的功率(强度)
    sigPower = sum(abs(X).^2)/length(X)             %求出信号功率
    noisePower=sum(abs(Y-X).^2)/length(Y-X)         %求出噪声功率
    SNR_10=10*log10(sigPower/noisePower)            %由信噪比定义求出信噪比,单位为db
    b=snr(X,Y-X)                             % snr(a,b) : a是原始信号,b是噪声信号
    snr(X)
    

    输出:
    SNR_10 =

       14.0033


    b =

       14.0033

    问题:

      MIT-BIH 那些数据吧,请问你知道原始ECG数据的信噪比是如何求出来的嘛?

    参考:http://blog.sina.com.cn/s/blog_b09328370102vr8g.html

               https://zhuanlan.zhihu.com/p/33033117

             例子2:

    clear all;clc; close all;
    %%%  calucate the signal snr 
    X = sqrt(2)*sin(0:pi/1000000:6*pi);               %产生正弦信号
    %% select this mode 
    Y = awgn(X,20,'measured');                          %加入信噪比为10db的噪声,加入前预估信号的功率(强度)
    z=awgn( X,20);
    
    figure
    subplot(311);plot(X);
    subplot(312);plot(Y)
    subplot(313);plot(z)
    
    sigPower = sum(abs(X).^2)/length(X)           %求出信号功率
    
    noisePower=sum(abs(Y-X).^2)/length(Y-X)  %求出噪声功率
    
    SNR=10*log10(sigPower/noisePower)          %由信噪比定义求出信噪比,单位为db\
    
    by=snr(X,Y-X)                             % snr(a,b) : a是原始信号,b是噪声信号
    bz=snr(X,z-X)
    
    %%%%caclute the  MSE
    mx=(sum(X)-sum(Y)).^2/length(X);
    mz=(sum(X)-sum(z)).^2/length(X);

     

    展开全文
  • Matlab产生高斯白噪声

    万次阅读 多人点赞 2017-01-18 23:06:40
    matlab中噪声功率、噪声方差关系 以matlab中awgn函数为例说明:  在matlab中无论是wgn还是... 根据awgn实现代码可以知道”向已知信号添加某个信噪比(SNR)高斯白噪声“,即:awgn(x,snr,’measured’,'linear
  • matlab中awgn函数为例说明: ... 根据awgn实现代码可以知道”向已知信号添加某个信噪比(SNR)高斯白噪声“,即:awgn(x,snr,’measured’,'linear’),命令作用是对原信号x添加信噪比
  • 是基于图像梯度信息进行处理,属于水平集范畴-Measured the active contour model code is based on the gradient of the image information processing, belonging to the scope of the level set
  • matlab中噪声功率、噪声方差关系

    万次阅读 2016-12-28 16:08:40
    matlab中awgn函数为例说明: ... 根据awgn实现代码可以知道”向已知信号添加某个信噪比(SNR)高斯白噪声“,即:awgn(x,snr,’measured’,'linear’),命令作用是对原信号x添加信噪比(比值)为
  • y=awgn(x,snr,px_dBW) ...‘measured’为根据x自动计算出来本身功率,即用x本身功率当作指定功率: px_W= norm(x)^2/length(x)(信号功率计算请参见本人另一边文章) px_dBW=10log10(px_W/1W) 有了信噪比s
  • AWGN:在某一信号中加入高斯白噪声y = awgn(x,SNR) 在信号x中加入高斯白噪声。信噪比SNR以dB为单位。x强度假定为0dBW。...如果SIGPOWER为'measured',则函数将在加入噪声之前测定信号强度。y = awgn(x,SNR,SIG...
  • matlab里面向信号里加入白噪声

    万次阅读 2015-12-18 11:13:26
    matlab中无论是wgn还是awgn函数,实质都是由randn函数产生噪声。即,wgn函数中调用了randn函数,而awgn函数中调用了wgn函数。  根据awgn实现代码可以知道“向已知信号添加某个信噪比(SNR)高斯白噪声”, ...
  • Matlab瑞利信道AWGNBPSK另一种仿真方法我毕设第二部分-rayleigh-awgn-BPSK仿真.txt 【资料名称】:rayleigh-awgn-BPSK仿真系统程序 【作者】:本人so 【内容简介】:用rayleighchan 函数仿真时要注意最后要做...
  • They can also be used for “terrainfollowing” navigation by correlating measured imagery with stored maps. 虽然雷达图像还没有达到光学图像分辨率,但是微波频率下电磁波低衰减特性使得雷达具有“透视”...
  • 2.6.3测量多普勒频移:空间多普勒 2.6.3. Measuring Doppler Shift: Spatial Doppler ...The Doppler shiftsobserved in radar are too small to be measured from a single pulse echo in most...
  • 给信号添加高斯白噪声是通过...X是原来信号,Y是添加高斯白噪声后信号,SNR是信噪比,当SIGPOWER是一个数字时候,表示是信号功率,以dBW计算,当SIGPOWER被指定为‘measured时候,意思是要在加噪声之前
  • Matlab 给信号加高斯白噪声AWGN

    千次阅读 2018-03-20 17:11:00
    AWGN:在某一信号中加入高斯白噪声y = awgn(x,SNR) 在信号x中加入高斯白噪声。信噪比SNR以dB为单位。x强度假定为0dBW。...如果SIGPOWER为'measured',则函数将在加入噪声之前测定信号强度。y = awgn(x,SNR,SIG...
  • Matlab】awgn高斯白噪声函数

    千次阅读 2015-12-06 16:48:00
    AWGN:在某一信号中加入高斯白噪声y = awgn(x,SNR)在信号x中加入高斯白噪声。信噪比SNR以dB为单位。x强度假定为0dBW。...如果SIGPOWER为’measured’,则函数将在加入噪声之前测定信号强度。 y = awgn(x,SNR,SIGP
  • measured'); %加白噪声 n=exp(j*2*pi*randn(N_array,N_snap))/snr;%噪声 SS=data+n; SS_FFT = zeros(N_array,N_snap*N_snap); for seg=1:N_snap %数据段 for m = 1:N_array ...
  • MATLAB复信号添加高斯加性白噪声 利用AWGN函数,并验证 clear; N=1000; sig=2*randint(1,N)+3*j*randint(1,N); %信号 y2 = awgn(sig,10,'measured'); %加入信噪比为10db噪声,加入前预估信号功率(强度)。 %---...
  • 1,matlab代码 close all;clc; clear all; st=200:-4:1;%采集150个数据,每次减1 st=zeros(1,200)+10;%采集150个数据,每次减1 %y = awgn(x,SNR,SIGPOWER)信噪比SNR以dB为单位;如果SIGPOWER是数值,则其代表以...
  • 用python给数据加上高斯噪声

    万次阅读 热门讨论 2019-06-27 16:49:08
    回顾MATLAB加高斯噪声2. Python中利用numpy给数据加噪声 一开始用MATLAB给数据加噪声很简单,就一句话: % 给数据加指定SNR高斯噪声 signal_noise = awgn(signal,SNR,'measured'); 但用python实现加噪声...
  • 添加高斯白噪声

    千次阅读 2019-05-07 10:54:00
    matlab中噪声功率、噪声方差关系 以matlab中awgn函数为例说明: 在matlab中无论是wgn还是...根据awgn实现代码可以知道”向已知信号添加某个信噪比(SNR)高斯白噪声“,即:awgn(x,snr,’measured’,'linear...
  • 转载自 川草天涯博客 以matlab中awgn函数为例说明: ... 根据awgn实现代码可以知道”向已知信号添加某个信噪比(SNR)高斯白噪声“,即:awgn(x,snr,’measured’,'linear’),命令作...
  • awgn、wgn函数添加噪声原理

    千次阅读 2017-05-21 10:48:28
    转载自 川草天涯博客 以matlab中awgn函数为例说明:  在matlab中无论是wgn... 根据awgn实现代码可以知道”向已知信号添加某个信噪比(SNR)高斯白噪声“,即:awgn(x,snr,’measured’,'linear’),命令

空空如也

空空如也

1 2
收藏数 33
精华内容 13
关键字:

matlab的measured

matlab 订阅