필터 지우기
필터 지우기

"Undefined function 'times' for input arguments of type 'channel.rician'" error on MATLAB, how to fix it?

조회 수: 1 (최근 30일)
When i run the following code, i have an error, what is the problem? Here is the code:
clear all; close all; clc;
% basic inputs =============================
fc=2e9; % Hz Carrier frequency
F=16; % sampling rate: fraction of wave length
V=10; % m/s MS1 speed
NFFT=128; % Number of points in FFT
Nsamples=100; % Number of samples
% geometry inputs ===========================
dBS=1000; % distance of BS to origin
alpha = 180; % degree. Angle of BS-MS with MS route
% inidirect gemeotric parameters ================
BSx=dBS*cosd(alpha); % loc of BS x-coord
BSy=dBS*sind(alpha); % loc of BS y-coord
% indirect parameters ===========================
c=3e8;
lambdac=c/fc; % m wavelength
Dx=lambdac/F; % m sampling spacing
ts=Dx/V; % s time sampling interval
fs=1/ts; % Hz sampling frequency
kc=2*pi/lambdac; % propagation constant
timeaxis=ts.*[0:Nsamples]; % s elapsed time axis
disaxis=Dx.*[0:Nsamples]; % n traveled distance axis
MSx=V.*timeaxis; % MS route sampling points
% radio path length==============================
distBSMS=sqrt((BSx-MSx).^2+(BSy).^2);
% complex envelope: amplitude and phase ===============
rx=1*exp(-1j*kc.*distBSMS)-exp(-1j*2*pi/(c./5e9).*distBSMS);
c1 = ricianchan;
r=c1.*rx;
% complex envelope spectrum ======================
spectrumr=fftshift((abs(fft(r,NFFT))).^2);
freqaxis=[0:NFFT-1]*fs/NFFT-fs/2;
% Plots =====================================
figure,plot(timeaxis,abs(r))
xlabel('Time (s)') ;
And this is the error:
Undefined function 'times' for input arguments of type 'channel.rician'

답변 (2개)

Walter Roberson
Walter Roberson 2017년 1월 8일
You cannot multiply a channel model by a value. You can use the channel model to generate samples and multiply the samples.
  댓글 수: 2
Deema42
Deema42 2017년 1월 8일
what do you mean by generating samples? can you give me an example please?
Walter Roberson
Walter Roberson 2017년 1월 8일
Sorry, I mistook it for being one of the random noise channels.
You have to use the ricianchan object to filter samples; you can then multiply the filtered samples.
Depending on your purpose in doing the multiplication, you might consider instead changing the AvgPathGaindB property of the channel.

댓글을 달려면 로그인하십시오.


Honglei Chen
Honglei Chen 2017년 1월 9일
You don't want to multiply the channel with the signal. Instead, you want to filter the signal with the channel, like the following:
r = filter(c1,rx)
HTH

카테고리

Help CenterFile Exchange에서 Matched Filter and Ambiguity Function에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by