OFDM Simulation in MATLAB

  Рет қаралды 80,988

Jordan Street

Jordan Street

Күн бұрын

EEL6509 Wireless Communications
University of Florida
Electrical and Computer Engineering

Пікірлер: 210
@BoutinMathieu
@BoutinMathieu Жыл бұрын
Very very nice job! You talk clearly and you kept things easy to understand.
@tayyabakhtar6157
@tayyabakhtar6157 6 жыл бұрын
here is the code !! :) enjoy clear all close all clc %% simulation parameters %modulation method: BPSK, QPSK, SPSK, 16QAM, 32QAM, 64QAM mod_method = 'QPSK'; % IFFT/FFT size n_fft = 64; %size of cyclic prefix extension n_cpe = 16; %target SNR (dB) snr = 20; %number of channel taps (1 == no channel) n_taps = 8; %channel estimation method: none, LS ch_est_method = 'LS'; %option to save plot to file save_file = 0; %calculate modulation order from modulation method mod_methods = {'BPSK', 'QPSK', '8PSK', '16QAM', '32QAM', '64QAM'}; mod_order = find (ismember (mod_methods, mod_method)); %% input data do binary stream im = imread('baboon.bmp'); im_bin = dec2bin(im(:))'; im_bin = im_bin(:); %% binary stream to symbols %parse binary stream into mod_order bit symbols %pads input signal to appropriate length sym_rem = mod( mod_order-mod( length( im_bin), mod_order), mod_order); padding = repmat ( '0', sym_rem, 1); im_bin_padded = [im_bin; padding]; cons_data = reshape( im_bin_padded, mod_order, length(im_bin_padded)/mod_order)'; cons_sym_id = bin2dec(cons_data); %% symbol modulation %BPSK if mod_order == 1 mod_ind = 2^(mod_order-1); n = 0:pi/mod_ind:2*pi-pi/mod_ind; in_phase = cos(n); quadrature = sin(n); symbol_book = (in_phase + quadrature*1i)'; end %phase shift keying about unit circle if mod_order == 2 || mod_order == 3 mod_ind = 2^(mod_order-1); n = 0: pi/mod_ind: 2*pi-pi/mod_ind; in_phase = cos(n+pi/4); quadrature = sin(n+pi/4); symbol_book = (in_phase + quadrature*1i)'; end %16QAM, 64QAM modulation if mod_order == 4 || mod_order == 64 mod_ind = sqrt(2^mod_order); in_phase = repmat(linspace(-1, 1, mod_ind), mod_ind, 1); quadrature = repmat(linspace(-1, 1, mod_ind)', 1, mod_ind); symbol_book = in_phase(:) + quadrature(:)*1i; end %32QAM modulation %generates 6x6 constellation and removes corners if mod_order == 5 mod_ind = 6; in_phase = repmat(linspace(-1, 1, mod_ind), mod_ind, 1); quadrature = repmat(linspace(-1, 1, mod_ind)', 1, mod_ind); symbol_book = in_phase(:) + quadrature(:)*1i; symbol_book = symbol_book([2:5 7:30 32:35]); end %modulate data according to symbol_book X = symbol_book(cons_sym_id+1); %% use IFFT to move to time domain %pad input signal to appropriate length fft_rem = mod(n_fft-mod(length(X), n_fft), n_fft); X_padded = [X; zeros(fft_rem,1)]; X_blocks = reshape(X_padded, n_fft, length(X_padded)/n_fft); x = ifft(X_blocks); %add cyclic prefix extension and shift from parallel to serial x_cpe = [x(end-n_cpe+1:end,:);x]; x_s = x_cpe(:); %add AWGN %calculate data power data_pwr = mean(abs(x_s.^2)); %add noise to channel noise_pwr = data_pwr/10^(snr/10); noise = normrnd(0,sqrt(noise_pwr/2),size(x_s)) + normrnd(0, sqrt(noise_pwr/2), size(x_s))*1i; x_s_noise = x_s + noise; %measure SNR snr_meas = 10*log10(mean(abs(x_s.^2))/mean(abs(noise.^2))); %% apply fading channel g = exp(-(0:n_taps-1)); g = g/norm(g); x_s_noise_fading = conv(x_s_noise, g, 'same'); %% use fft to move to frequency domain %remove cyclic prefix extension and shift from serial to parallel x_p = reshape(x_s_noise_fading, n_fft+n_cpe, length(x_s_noise_fading)/(n_fft+n_cpe)); x_p_cpr = x_p(n_cpe + 1:end,:); %move to frequency domain X_hat_blocks = fft(x_p_cpr); %% estimate channel if n_taps > 1 switch(ch_est_method) case 'none' case 'LS' G = X_hat_blocks(:,1)./X_blocks(:,1); X_hat_blocks = X_hat_blocks./repmat(G,1,size(X_hat_blocks,2)); end end %% symbol demodulation %remove fft padding X_hat = X_hat_blocks(:); X_hat = X_hat(1:end-fft_rem); %recover data from modulated symbols rec_syms = knnsearch([real(symbol_book) imag(symbol_book)], [real(X_hat) imag(X_hat)]) - 1; %parse to binary stream & remove symbol padding rec_syms_cons = dec2bin(rec_syms); rec_im_bin = reshape(rec_syms_cons', numel(rec_syms_cons),1); rec_im_bin = rec_im_bin(1:end-sym_rem); ber = sum(abs(rec_im_bin - im_bin))/length(im_bin); %% recover image rec_im = reshape(rec_im_bin,8, numel(rec_im_bin)/8); rec_im = uint8(bin2dec(rec_im')); rec_im = reshape(rec_im,size(im)); %% generate plots %transmit constellation subplot(2,2,1); plot(X, 'x', 'linewidth', 2, 'markersize', 10); xlim([-2 2]); ylim([-2 2]); xlabel('In Phase'); ylabel('Quadrature'); if n_taps > 1 title(sprintf('Poslani konstelacijski dijagram \ m%s Modulacija Multipath Channel Taps: %d', mod_method, n_taps)); else title(sprintf('Poslani konstelacijski dijagram \ m%s Modulacija', mod_method)); end grid on; %recovered constellation subplot(2,2,2); plot(X_hat(1:500:end),'x','markersize',3); xlim([-2 2]); ylim([-2 2]); xlabel('In Phase'); ylabel('Quadrature'); if n_taps > 1 title(sprintf('Primljeni konstelacijski dijagram \ mMeasured SNR: %.2f db Channel Estimation: %s', snr_meas, ch_est_method)); else title(sprintf('bfPrimljeni konstelacijski dijagram \ mMeasured SNR: %.2f dB', snr_meas)); end grid on; %original image subplot(2,2,3); imshow(im); title('\bfPoslana slika'); %recovered image subplot(2,2,4); imshow(rec_im); title(sprintf('\\bfOporavljena slika \ mBER: %.2g', ber)); %position figure %set(gcf,'Position',[680 287 698 691]); %save figure if save_file print(sprintf('Plots/%s_%.0ffft_%.0fcpe_%0fdB_%.0ftaps_%s',mod_method, n_fft, n_cpe, snr, n_taps, ch_est_method), '-dmeta'); end
@alvaromartelo3885
@alvaromartelo3885 4 жыл бұрын
Hi Jordan. I watched your video about implementing OFDM in Matlab. However I'm getting some errors in the reshaping of the image, I'm getting BERs of 30% and 50% from the same parameters you use in your video, could you help me out? I don't know why the code is failing
@m.o.e6210
@m.o.e6210 4 жыл бұрын
hey jordan. i'm facing issue with knnsearch function at symbol demodulation section Error says:"Error using imag Not enough input arugment". Have any idea how I can fix that.
@southpark4151
@southpark4151 3 жыл бұрын
Nice video! Can I ask what method was used to remove the cyclic prefix at the receiver side? At the receiver side ----- not on the transmitter side. Thanks!
@chrish9506
@chrish9506 4 жыл бұрын
Great video!
@hughvera3569
@hughvera3569 11 ай бұрын
can be used this script in digital fm IBOC? with WB=200 khz and df=19 KHZ
@gbtjom
@gbtjom 8 жыл бұрын
Great presentation. Is the code available somewhere? thx.
@poornimaa351
@poornimaa351 2 жыл бұрын
Hello Jordan could you please share the code??? It will be really helpful, I ran this code but I am getting the BER=0.22, don't know why? whereas you showed in the video BER=.098. could you please help me? thanks
@murodkurbanov2901
@murodkurbanov2901 8 жыл бұрын
perfect. could you you help me with the that code please?
@dafragar
@dafragar 8 жыл бұрын
Hi Jordan,Is it possible to get the code?
@srikanth43354
@srikanth43354 Күн бұрын
am trying to do this on same boaed in gnu radio any help is appreciated
@arjunmenonkandanat6328
@arjunmenonkandanat6328 4 жыл бұрын
Line 146 you need to write rec_im = uint8(bin2dec(num2str(rec_im'))); Otherwise error will come
@kingleynut6539
@kingleynut6539 3 жыл бұрын
Does someone have the same simulation code for Fbmc help urgent for assignment 🙏🙏
@Joey5537
@Joey5537 5 жыл бұрын
Category is Comedy? It's a tad dry standup performance for my taste, but I learned a lot!
@yarondorman
@yarondorman 4 жыл бұрын
Great presentation! Looking at the matlab code, Why is the AWGN added before the channel convolution? In a typical model, the signal should 1st pass through a channel and only then an AWGN is added.
@franciscogerardohernandezr4788
@franciscogerardohernandezr4788 3 жыл бұрын
I noticed the same issue, so I compared the code to the Yong Soo OFDM book samples and indeed, it is flipped.
@yuvistorm
@yuvistorm Жыл бұрын
I'm working on a project where I have to design Analysis of SNR Metrics for a Typical Underwater Acoustic OFDM System. Could you please send me the code it would be very helpful in my project
@noknackman
@noknackman 5 жыл бұрын
I have got an error in reshape function, plz can you help(line 40)
@dharunsangrithiyayan6773
@dharunsangrithiyayan6773 4 жыл бұрын
please send code
@hluizmelo
@hluizmelo 8 жыл бұрын
Hello, congratulations, nice video. After constellation mapper, the phasors into the IFFT block, but the IFFT is a sum. How can the output be parallel?
@hluizmelo
@hluizmelo 8 жыл бұрын
+Jordan Street image.slidesharecdn.com/thamkhaoofdm-tutorial-150608094800-lva1-app6891/95/tham-khao-ofdm-tutorial-7-638.jpg?cb=1433756946
@rafaliu011
@rafaliu011 3 жыл бұрын
Great!!!
@touchmycunt2874
@touchmycunt2874 3 жыл бұрын
Bro if u still get notifications . It would be of great help if you could provide me with the code
@LIJINGVARGHESEBEC
@LIJINGVARGHESEBEC 6 жыл бұрын
Nice work actually I'm working on a project where I have to design OFDM based Tx and Rx could you please send me the code it would be very helpful in my project
@LIJINGVARGHESEBEC
@LIJINGVARGHESEBEC 6 жыл бұрын
mail id lijingvarghese@gmail.com
@safsf.a9211
@safsf.a9211 3 жыл бұрын
Please i want to lecture , i need it because the Graduation project
@ISDANA1
@ISDANA1 8 жыл бұрын
Congratulation Jordan.I loved your exploration. Can you help me I have some doubts?
@ISDANA1
@ISDANA1 8 жыл бұрын
+Claudia Toledo (ctoledonunes@hotmail.com)
@ISDANA1
@ISDANA1 8 жыл бұрын
Please help me if you can with the questions below, if its not possible, can you indicate who /where could help me? About OFDM ( to LTE 4 G) 1- bandwidth allocated to each carrier and carrier amount allocated to each user ;2- number of subcarriers per carrier and quantity of points of IFFT / FFT multiplexing ;3 subcarriers to the reference ( synchronization , AGC , equalizing , etc. );4 subcarriers unsigned (to avoid interference between adjacent carriers ) ;5- sampling frequency of the modulated carrier ;6- type convolutional code (FEC );7-kinds modulation ( BPSK , QPSK , QAM) ;8- scrambling ;9- equalization algorithm ;10- estimation algorithm for signal demodulation ; (ctoledonunes@hotmail.com)
@hamidhamidbenyahia6347
@hamidhamidbenyahia6347 4 жыл бұрын
can you plese send me your code , fyi my email (hamid20101995@gmail.com) and thank you
@laizadelara1122
@laizadelara1122 4 жыл бұрын
Alguem conseguiu o codigo?
@tayyabakhtar6157
@tayyabakhtar6157 6 жыл бұрын
Your tutorial is very helpful. can u please send me the matlab code ?
@maryemsabor7141
@maryemsabor7141 7 жыл бұрын
please could you send me the MATLAB code :)and Thank you
@omardjemili7152
@omardjemili7152 7 жыл бұрын
Since the code is available elsewhere, Why didn't you accept to send it ! what's the problem in sharing the code with others ?
@JordanStreet
@JordanStreet 7 жыл бұрын
om ar then go get the code from elsewhere :)
@omardjemili7152
@omardjemili7152 7 жыл бұрын
i said that because you said "I will not give it since there is a plenty of examples existing"
@joshuaabolade4155
@joshuaabolade4155 7 жыл бұрын
Please i am doing something on vlc and I want to use ofdm .....please can you send me the code ....and any additional information. .Thanks
@joshuaabolade4155
@joshuaabolade4155 7 жыл бұрын
email is josh.abolade@gmail.com
@smaouiachraf8533
@smaouiachraf8533 7 жыл бұрын
Hi Joshua Abolade, please can you send me the matlab code? email is smaouiachraf290@gmail.com. thank you
@potobill
@potobill 8 жыл бұрын
Good job. Is the code online?
@areebsaldin9258
@areebsaldin9258 8 жыл бұрын
+potobill yes
@potobill
@potobill 8 жыл бұрын
+areeb saldin aight. thanks
@santiago6952
@santiago6952 4 жыл бұрын
Hi... where's the code
@hungthe5658
@hungthe5658 7 жыл бұрын
Hi Jordan Street, Thank you for your sharing! Your lecture is very helpful for my project. Would you mind sharing your matlab code with me! Thanks!
@hungthe5658
@hungthe5658 7 жыл бұрын
my email is: hungnt515@gmail.com
@b3vuu9t22
@b3vuu9t22 5 жыл бұрын
Hello, could you send me this code ? Appreciate !!
@christianruales5519
@christianruales5519 4 жыл бұрын
Did you get it?
@arjunmenonkandanat6328
@arjunmenonkandanat6328 4 жыл бұрын
@@christianruales5519 ha ha
@gopirajdokku3570
@gopirajdokku3570 4 жыл бұрын
link for the code kr.mathworks.com/matlabcentral/fileexchange/67156-ofdm-channel-estimation-in-matlab
@mohamedhtful
@mohamedhtful 8 ай бұрын
THANKS VERY NICE I want PDF FILE
@youeng1
@youeng1 7 жыл бұрын
Your tutorial is very helpful. I am interesting could you send me the MATLAB code please
@youeng1
@youeng1 7 жыл бұрын
youeng75@gmail.com
@bouchrasaim1376
@bouchrasaim1376 7 жыл бұрын
me too i'm interesting would you send me the MATLAB code please it's very important for my thesis please : saimbouchra@gmail.com
@terziuvasi8424
@terziuvasi8424 7 жыл бұрын
Hello. You receive the matlab code from Jordan? Thanks
@ActioNizza
@ActioNizza 6 жыл бұрын
can you plese send me your code, or give me yuor mail
@youeng1
@youeng1 6 жыл бұрын
Hi everyone, I didn't receive the code yet.
@julioernestocardenaslopez8296
@julioernestocardenaslopez8296 8 жыл бұрын
Very good! Is it possible to get the code???
@tuntunlinn57
@tuntunlinn57 6 жыл бұрын
your video is very helpful I am interesting could you send me the MATLAB code please
@tuntunlinn57
@tuntunlinn57 6 жыл бұрын
zdggerp@gmail.com
@LoveYourLife2704
@LoveYourLife2704 4 жыл бұрын
cons_sym_id does not work
@moussacissoko59
@moussacissoko59 5 жыл бұрын
your video is very interesting can you share with me your Matlab code
@MAWARIR
@MAWARIR 8 жыл бұрын
How come he did not use any of the pilot schemes in this project.
@whateeverelse
@whateeverelse 5 жыл бұрын
He does! But only one pilot in the frequency domain for the first OFDM symbol block, see line 125. He assumes the first n_fft symbols of the image are known to the receiver.
@lisabraun3899
@lisabraun3899 5 жыл бұрын
Hi can you send me this matlab code? Thanks :)
@JordanStreet
@JordanStreet 5 жыл бұрын
Elizabeth Butler Sure thing! Thanks for asking, it’s on it’s way!
@jayantbenjamin4307
@jayantbenjamin4307 4 жыл бұрын
Did you get the code? can you send it to me as well? jayant.b@somaiya.edu
@dharunsangrithiyayan6773
@dharunsangrithiyayan6773 4 жыл бұрын
@@JordanStreet jordan please provide us.code
@omerjawaid77
@omerjawaid77 4 жыл бұрын
hey please can you giive the code?
@engkareemhamed
@engkareemhamed 5 жыл бұрын
please i study PHD in Cairo and need help from you in matlab my paper can send to me your email please to send to you my problems
@tayyabakhtar6157
@tayyabakhtar6157 6 жыл бұрын
code dede yar bhai hoga :p
@ShubhamBhargava11
@ShubhamBhargava11 6 жыл бұрын
I have the code...incase anyone is interested.
@ridzuanroslan3833
@ridzuanroslan3833 5 жыл бұрын
please share with me.. irridzuan12@gmail.com thanks
@mahadevbhat9704
@mahadevbhat9704 5 жыл бұрын
please share with me bhatmahadev6@gmail.com
@lioneldiurk.7049
@lioneldiurk.7049 5 жыл бұрын
can you please send it to kashmirger@gmail.com
@raghunadhsiram9517
@raghunadhsiram9517 5 жыл бұрын
please share the code with me rnsiram@gmail.com
@roshanlalkumawat9788
@roshanlalkumawat9788 5 жыл бұрын
send me the code on rlk7772626@gmail.com
@manasgarai6260
@manasgarai6260 7 жыл бұрын
Your tutorial is very helpful. can u please send me the matlab code ?
@manasgarai6260
@manasgarai6260 7 жыл бұрын
my email- mgarai63@outlook.com
GEL7014 - Module 4.13 - OFDM implementation
28:20
Leslie Rusch
Рет қаралды 20 М.
Wireless Design in MATLAB
54:47
MATLAB
Рет қаралды 45 М.
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 56 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 9 МЛН
Самый Молодой Актёр Без Оскара 😂
00:13
Глеб Рандалайнен
Рет қаралды 12 МЛН
НЫСАНА КОНЦЕРТ 2024
2:26:34
Нысана театры
Рет қаралды 1,1 МЛН
GEL7114 - Module 4.12 - OFDM introduction
19:36
Leslie Rusch
Рет қаралды 10 М.
Digital Communications: OFDM
37:12
Geoffrey Messier
Рет қаралды 30 М.
Generating and Analyzing LTE Signals with MATLAB
40:13
MATLAB
Рет қаралды 24 М.
OFDM Simulation in Matlab
51:04
Henry Carvajal
Рет қаралды 7 М.
OFDM - Orthogonal Frequency Division Multiplexing
4:39
Sunny Classroom
Рет қаралды 318 М.
CPU Pipeline - Computerphile
21:48
Computerphile
Рет қаралды 62 М.
Autopilot Design with XFLR and Simulink (Part 1)
1:28:47
Jordan Street
Рет қаралды 15 М.
Multi-User MIMO Beamforming in 5G New Radio
44:11
MATLAB
Рет қаралды 10 М.
What is a Cyclic Prefix in OFDM?
13:09
Iain Explains Signals, Systems, and Digital Comms
Рет қаралды 47 М.
QAM and OFDM Basics
19:17
YedaCenter
Рет қаралды 36 М.
ToRung short film: i sell watermelon🍉
0:38
ToRung
Рет қаралды 20 МЛН