Error using vertcat Dimensions of matrices being concatenated are not consistent
Show older comments
function [xt,time]=IFFT_oversampling(X,N,L)
% Zero-padding & NL-point IFFT
% => N-point IFFT & interpolation with oversampling factor L
if nargin<3, L=1; end % Virtually, no oversampling
NL=N*L; T=1/NL; time = [0:T:1-T]; X = X(:);
xt = L*ifft([X(1:N/2) zeros(1,NL-N) X(N/2+1:end)], NL);
T = [ I(1:2:n-1), I(2:2:n)];
Can anybody help me, cant understand why do i get this error when i run it?
i have attached written the function above.
thanks
Answers (1)
Star Strider
on 12 Jan 2020
Since you have defined ‘X’ as a column vector, you likely need to vertically concatenate the ifft arguments in ’xt’ instead of horizontally concatenating them:
xt = L*ifft([X(1:N/2); zeros(NL-N,1); X(N/2+1:end)], NL);
Note the use of semicolons (;) to do the vertical concatenation, as well as defining the zeros call to produce a column vector by re-arranging its arguments.
The next problem is that ‘I’ is undefined. You need to figure out what you want it to be, keeping in mind that ‘T’ will work if it is a row vector and may not work not if ‘I’ is a column vector.
I leave those to you.
Categories
Find more on OFDM in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!