Error in plot(t,[y x]).. can anyone help me with this code i am trying matched filter of rectangular pulse to awgn signal..firstly i am convolving these two signals ande then taking and then matching. what is wrong in this code
이전 댓글 표시
clear; % sampling frequency fs = 1e9; % time duration for pulse of start and end td = 10e-9; % number of steps in linspace N = 513; % width of rect pulse w= 1e-9; % time t = linspace(-td,td,N); dt = t(2)-t(1); T = t(end)-t(1) + (t(2)-t(1)); f = 1/T * (-(N-1)/2 : (N-1)/2); %square pulse subplot(3,2,1) y = rectpuls(t,w); plot(t,y) xlabel('Time') ylabel('Amplitude') title('rectangular pulse') grid on; %fourier transform of square pulse: ATsinc(fT) %where f is a frequency variable. A is the amplitude of the pulse, %assumed to be 1 subplot(3,2,2) Y = w*fft(y); sz = size (y) Yplot = fftshift(Y); plot(f,abs(Yplot)) xlabel('frequency') ylabel('Amplitude') title('fft=sinc func') grid on;
% noise added with signal x = awgn(y,10,'measured'); subplot(3,2,3) plot(t,[y x]) legend('Original Signal','Signal with AWGN') title('signal and noise') grid on % convolution at multiplier s1=fft(x); s2=fft(y); y2=conv(s1,s2) subplot(3,2,4) plot(y2) title('convolution of FFT') grid on % matched filter output y3=ifft(y2); subplot(3,2,5) plot(y3) title('matched filter output') grid on
댓글 수: 1
tk swetha
2021년 4월 5일
Y is there a error at step x=awgn(y,10,'measured');
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!