IFFT circular shifting problem

1 回表示 (過去 30 日間)
IIT MADRAS
IIT MADRAS 2013 年 3 月 11 日
Hi all,This is Yugandhar. I am working on communication system design. In this process I am using IFFT at the receiving end. I am sending one EM signal into the medium; it will reflect from the medium of discontinuity. But I am unable to get the time difference between the incident to reflected signals as expected. I have used the circular shift, but I am confusing how many samples I have to shift. It is like trail and error for me. Is there any rule to shift. How to resolve these issues. Can anyone help me. I am attaching the code. if true % codeclc; clear all; close all; Co=3e8; fc = 10e9; % center frequency f1 = 4e9; % start freq f2 = 16e9; % stop freq f0 = f2; % fmax srate = 7; % sampling rate, fs=srate*f0 fs = srate*f0; % sampling frequency N = 1024; %Number of points in the DFT d1=700*1e-3; df = fs/N; % sampling in freq (delta_f) dt = 1/fs; % sampling interval in seconds Tv = (0:N-1)*dt; % time vector (window span:[0,N*dt]sec) % dt=1e-12; % fs=1/dt; % N = round(Tr/dt); % Tv=(0:N-1)*dt; % df = fs/N; % Variables used for window creation n1 = round(f1/df); n2 = round(f2/df); n3 = round(fs/2/df); fvec = linspace(0,fs,N); er2=4.5; e0=10; % Intrinsic impedances of the mediums eta1= 120*pi; eta2= eta1/sqrt(er2); % Reflection and transmission coefficients calculation tau12= (2*eta2)/(eta2+eta1); gamma0=(eta2-eta1)/(eta2+eta1); % Window creation to apply in the lower side of the DGFspectrum M = (n2-n1)+1; Wf0= [zeros(1,n1-1),window(@chebwin,M)',zeros(1,N-n2)]; %Window creation to apply in the higher side of the DGFspectrum Wfh= [zeros(1,N-n2),window(@chebwin,M)',zeros(1,n1-1)]; n=0; for freq=fvec omega = 2*pi*freq; % angular frequency beta= omega/Co; % phase constant of the second medium n=n+1; % gamma(1,n)= (gamma0)*exp(-1i*2*beta*d1); Ei(1,n)=e0*exp(-1i*beta*d1); Er(1,n)=gamma0.*(e0*exp(1i*beta*d1)); end Xf2(1,:)= Ei(1,:)+Er(1,:); % XWf = filterd output from window applied at LSB Spectrum XWf0(1,:) = Wf0.*Xf2(1,:); % XWfh = filterd output from window applied at HSB Spectrum XWfh(1,:) = Wfh.*Xf2(1,:);
% XWF = Filtered output of the DGF Spectrum XWF0(1,:) =(XWfh(1,:)+XWf0(1,:)); %time domain signal obtained at the receiver end xwt1(1,:) = ifft(XWF0(1,:),N); % xwt1 = circshift(real(xwt1),[1,-floor(N/2)])
figure, plot(Tv,real(xwt1(1,:))); grid on; end

回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by