63 Threads found on edaboard.com: Generate Random Bits Matlab
Just try this
samples=10000; %whatever number of samples you want
Z=rand(1,samples);
Z(find(Z<=0.25))=-1;
Z(find(Z>=0.75))=1;
Z(find(Z>=0.25&Z<0.5))=-j;
Z(find(Z>=0.5&Z<0.75))=j;
what u have written is for baseband i suppose.. and more over, urs doesnt strictly follow any random distributiom.. i mean for more valu
Digital Signal Processing :: 08.03.2005 21:10 :: cedance :: Replies: 4 :: Views: 2518
Please help guys.. i need to perform the run and correlation property on a stream of bits that has been pseudorandomly generated.
I have used the following piece of code: e.g x= randn(10,1)>0.5 to generate random bits of 0's and 1's. Is this the correct way of doing it or do i need to (...)
Digital communication :: 10.12.2009 16:33 :: dammadmin :: Replies: 0 :: Views: 575
do you need a transmitter or receiver code? here is a code following you may use that code or compare your code with this one for any correction/improvement.
for more info visit
check this link also
qpsk matlab code
Code starts from here, visit th
PC Programming and Interfacing :: 18.02.2010 06:05 :: hanif :: Replies: 1 :: Views: 917
Does anybody know where to get a matlab file that generates very close to independent random samples? If you look at the higher order statistics of rand or randn, they are not as independent as I would like them to be. Any suggestions?
hi,
inorder for u to generate random numbers, u could use the PN (...)
Digital Signal Processing :: 08.03.2005 20:59 :: cedance :: Replies: 12 :: Views: 2191
If u want to write a script then i wud suggest the following:
8PSK symbols consist of 3 bits
-Suppose u need to generate N bits total≈N/3 symbols
-start with taking 3 bits in an array at a time and compare this with (000) or (011) etc and assign the 8psksig to be equal to (x+iy) where (x,y) E {-1,0,1} depending (...)
Digital communication :: 28.04.2006 14:36 :: carpediem.td :: Replies: 14 :: Views: 15862
%--------------------------------------------------------
% generate a random list of information bits (0/1)
encoder_in=randint(1,L_info,2);
encoder_out=cnv_encd(G,k_in,encoder_in);
%--------------------------------------------------------
if addinter ==1
en_output1 = (...)
Digital communication :: 05.03.2008 05:44 :: ahmedseu :: Replies: 6 :: Views: 17341
Can anyone help me with coding in matlab??
I'm trying to generate PRBS and then add noise (AWGN) to it.
Then try to decode it using sequential decoding(hard decision)..
Does any1 know how to do this?
PLEASE HELP ASAP...
Thanks in advanced
Digital communication :: 18.02.2009 15:47 :: Angel_s :: Replies: 3 :: Views: 1316
I am a newbie, and i would really appriciate the help of you guys. This project is required to my Digital communication course. Due to many issues and the huge projects that im working on i cant finish it, and it need to submit it tomorrow till 11:59PM otherwise i'll fail the course. please help me with the matlab code.
Digital Signal Processing :: 31.01.2011 17:13 :: blooz :: Replies: 1 :: Views: 358
You need to:
1. generate random bits and store them
2. modulate them (QPSK)
3. do whatever transmit MIMO processing you have
4. send them across a channel
5. demodulate them (QPSK demod)
6. compare your demodulated bits to transmit bits; BER from monte carlo is given by (...)
Digital communication :: 26.03.2013 16:04 :: Shug :: Replies: 3 :: Views: 128
hi,
i have to generate a 64 bit length pseudorandom sequence. I mean to code in VHDL. Is there a necessity for knowing the polynomials that are required for genereating the sequence... or how to know from which of the register i have to tap the output??? i wanted to know this method for generating any length PN sequence. or any other way out is
Electronic Elementary Questions :: 10.10.2004 06:28 :: cedance :: Replies: 4 :: Views: 2014
currently i am doing research in awg(array waveguide grating) and i am facing a problem on the transfer function of the awg as i got a pulse shape act like a multiple filter, and i dont know whether is it correct or not.
secondly is i am facing problem on the frequency spectrum of my input signal as i cant generate it properly in frequency spect
RF, Microwave, Antennas and Optics :: 18.10.2004 09:12 :: RO :: Replies: 0 :: Views: 714
Hi, folks
I wanna do software simulation for the quadrature phase shift keying (QPSK), but don't understand the principle very much.
If using the rand function to generate the original message. Then how to divide the original message into I and Q channel. Just simply put the odd number of the original message to I channel and even number to Q
Digital Signal Processing :: 03.12.2004 17:28 :: zhanch :: Replies: 12 :: Views: 19226
i want to design simulink model as follows
give image input to crc generator block(available in simulink)
i also want to view this image,(lets say if i had to view a signal i would use
oscilloscope)next crc generator block will take 48 image bits calculate crc and
will produce the output(image +crc bits)
now i want to add noise again i want
Digital Signal Processing :: 10.08.2005 20:13 :: fakeha_s :: Replies: 3 :: Views: 1718
To simulate INL and DNL by Hspice and Specture is hard and waste time.Ususlly simulate the converter's FFT is another economic method.
Dear schwang1970,
I try use simulink to do A/D. I generate my inputs. But my inputs are 0 or 1.
They are not regular.How do I do that my inputs connected my 12 bits D/A.
And how
Analog Circuit Design :: 19.09.2005 13:59 :: yen :: Replies: 9 :: Views: 1069
Hi
I guess the right thing to do is the following
1. generate the random signals, take the FFT and show its spectrum.
2. spread the signal using any code, take the FFT and show its spectrum.
3. add noise (the simplest case is AWGN), despread the signal, take the FFT and show its spectrum.
I am not sure if you did that in your figures above
Digital communication :: 13.03.2006 13:24 :: Sal :: Replies: 10 :: Views: 14273
A direct way to check if the sequency is truly random is to use auto-correlation function in matlab. A true random sequence should generate a Dirac type auto-correlation output, whose Fourier Transform should give you 'white' spectrum density function.
In matlab, you can use xcorr(A), where A is your (...)
Digital Signal Processing :: 11.04.2006 00:43 :: willyboy19 :: Replies: 5 :: Views: 736
i need the matlab to generate 64 qam and also to convert 64 qam to 16qam
Digital communication :: 28.02.2009 08:02 :: sathish2610 :: Replies: 24 :: Views: 19746
I've never used the reshape function so I can't help you there.
So you're using an image as the watermark. During my course we called it stamping. How are you embedding the watermark in the spatial domain or the frequency domain? You will need to determine a default size of your stamp compared to the image you're stamping so that the psnr would be
Software Problems, Hints and Reviews :: 28.01.2007 01:21 :: III :: Replies: 23 :: Views: 10252
HI...I am doing my degree project on Sequential decoding...
Can any1 plz help me to write the matlab codes?
actually i do understand the steps involved but i don't know matlab..
1.generate PRBS
2.encode using convolutional encoder
3.add noise
4.sequential decoder
5.decode sequentially(hard decision-trees)
6.compare encoded (...)
Digital communication :: 18.02.2009 17:02 :: Angel_s :: Replies: 105 :: Views: 24221
hi everybody!i need some help with this example!!could you please somebody help me!?
1. Simulation of digital modulations
generate the vector of random bits (hint: you can use rand in matlab) . Map them according the constellation of QPSK, BPSK, 8PSK or 16QAM (selectable by the user). Filter the signals by raised (...)
Digital Signal Processing :: 29.04.2008 12:03 :: alex_pap8 :: Replies: 3 :: Views: 634
hello everybody ! i need help with this example!!!could you please help me?!any body?!!?
1. Simulation of digital modulations
generate the vector of random bits (hint: you can use rand in matlab) . Map them according the constellation of QPSK, BPSK, 8PSK or 16QAM (selectable by the user). Filter the signals by raised (...)
Digital Signal Processing :: 29.04.2008 12:21 :: alex_pap8 :: Replies: 1 :: Views: 1447
Hmm... why it seems like there's some error with the code? It says 'error using pskmod' and 'too many input argument'. Anyway, how do I load the video into the code for transmission? How to split it into frames so that it could be transmitted? Thanks!
Added after 4 minutes:
SAJ25, here is the code frm math
Digital communication :: 23.08.2008 07:36 :: abling8 :: Replies: 5 :: Views: 1597
hey friend, i didn't realize myself this code just from this forum, so you will change apprapriative rules, just i will show you some examples, because nobody doesn't write full code gor you just they will show you way, sorry it is true.
this is channel but with DQPSK
change pls to QAM;
M = 4; % Use DQPSK in this example, so M is 4.
x = randi
Digital communication :: 01.04.2009 02:54 :: mashhur :: Replies: 3 :: Views: 3448
Deat friends, im stuck with the following problem.
I need to generate a binary data stream/array e.g x= of duration T seconds. I can do the array using rand function but still im unable to understand how to do the duration of T s.
also for me to be able to proceed to QPSK modulation i need to find the I and Q streams
Digital communication :: 09.12.2009 17:33 :: dammadmin :: Replies: 7 :: Views: 4083
generate a random bit stream. Group 6 bits into one complex symbol. The complex symbol should be one of the points in the constellation. You need to first define the constellation points and just map 6 bits into one of the constellation point. Does this answer your question? or you want to do more?
Digital communication :: 06.01.2010 17:10 :: srksp :: Replies: 1 :: Views: 1411
Thanks Mathuranathan you helped me understand how to define the band width of a filter.
but how do I define the bit rate W?
which kind of parameter is will change the W?
The term "Bit rate" literally means how fast we want to transfer the data with the available bandwidth. For example in the case of GSM the available
Digital communication :: 15.04.2010 04:19 :: mathuranathan :: Replies: 29 :: Views: 3124
Hi guys, this is my first work in optical and first simulation in matlab. I am sorry if there is mistake and im really new to this.
Here is what I did, im simulation an entire Radio Over Fiber system with matlab, linear system.
Let me insert my code first,
%*****************************Defining constant parameter****************
%Rb
RF, Microwave, Antennas and Optics :: 22.04.2010 21:18 :: thavamaran :: Replies: 0 :: Views: 597
Hi there, I have been simulating a system in matlab.
So Im not good with communication basics and im very new to it.
Here is the problem.
Im using rectpulse function from matlab, the it needs a sampling rate to generate rectpulse from random bits.
So the sampling rate is calculated using, (...)
Digital communication :: 27.05.2010 20:59 :: thavamaran :: Replies: 0 :: Views: 479
I just start with my final project of OFDM with QAM to generate a rondom data i just
did
FFTLen = 64; % Length of FFT.
M = 4; % bits encoded in a QAM symbol.
input = randint(FFTLen*M,1) > 0.5% 0 or 1
then i did a in blocks of 4 rows with 64 symbol
input_para = reshape(input,FFTLen,M);
later when i do the command qammmod
Digital communication :: 28.05.2010 01:46 :: asmaebentl :: Replies: 3 :: Views: 922
your code is not wrong in syntax but the channel you generate is not practical. do you have any syntax errors in this code ? The delay spread is the length of the channel (16 * sampling period) and the symbol time is the length of the symbol (usually = sampling period), the degree of ISI can be quantified as delay spread/ Symbol duration = it means
Digital communication :: 10.11.2011 07:50 :: Ahmed Alaa :: Replies: 13 :: Views: 568
How to generate delay in the following bit sequence using matlab.
My bit sequence is d(n) =
and my delay has to be d(n-1)...
What is the matlab code for generating delay d(n-1).
Thanx.
Digital communication :: 29.11.2011 06:08 :: Shruti01 :: Replies: 29 :: Views: 839
hello...
I have to write a matlab code for fsk transmitter. I have generated a binary data sequence. Converted those bits into frequencies of 10000 hz and 8000 Hz. if input bit=1 ten the signal will b a cosine wave having frequency 10000 Hz and if the input bit=0 ten the signal will b a cosine wave having frequency 8000 Hz. after this wat (...)
Digital communication :: 09.01.2012 07:27 :: Shruti01 :: Replies: 2 :: Views: 1393
Hello,
I have written a matlab code for ask modulation and demodulation. I have taken 1 bit at a time, modulated tat bit, added noise to it and demodulated that bit to recover the original data bit. I need to modify this code for all the bits present in the data sequence.... I have to repeat the above steps for 10 bits... How to do tat.. (...)
Digital communication :: 03.02.2012 08:24 :: Shruti01 :: Replies: 2 :: Views: 932
Hi all,
I need to add convolutional coding for the program below, but i dont understand what I need to the poly2trellis(ConstraintLength,CodeGenerator) variables for ConstraintLength,CodeGenerator. my messages are 10 binary bits long so matrix.
any help please??
clear, clc;
Eb=1;
i = 0;
trellis=poly2trellis);
for SNR=0:16
erro
Digital communication :: 06.03.2012 15:53 :: robinsjj01 :: Replies: 0 :: Views: 429
how to generate an ensemble that consists of 1000 waveforms, each containing 1000 bits,for the line codes(Unipolar,Return to Zero,AMI)
Software Problems, Hints and Reviews :: 13.03.2012 22:15 :: comm engineer :: Replies: 0 :: Views: 314
Hi,
This is the old reply.. i delete it because i coded it and i send you the code.
i advise you :
1. You must precise fc (carrier frequency), fs (sampling frequency) and B (baud rate). Then, N=fs/B will be the number of sample in one symbol of period T=1/B;
2. Time vector t=0:1/fs:(N-1)/fs; % time for one symbol
3. M=4; % 4 state for
Digital communication :: 09.04.2012 10:14 :: ChakerQ :: Replies: 13 :: Views: 516
hello all,
i wrote this code:
N=10000; %number of data bits
data=randn(1,N)>=0; %generate uniformly distributed random data
Fs=20*10.7e+6; %Sampling frequency
Rb=Fs*(1/10);
Tb=1/Rb;
Fc=10.7e+6;
snrdb=10; % Eb/N0 range in dB for simulation
time_bpsk=0:(1/Fs):Tb*(length(data))-(1/Fs);
carrier=cos(2*pi*Fc*time_bpsk);
figure; (...)
Digital communication :: 02.05.2012 02:50 :: yamid :: Replies: 1 :: Views: 305
hello all,
i tried to measure the CNR from the spectrum of a noisy carrier but the result is not precise, i get 6.6 dB attenuation from the real CNR, im sure that this is because i dont normalize something, can somebody please tell me how to do it correctly or what is the problem in my code.
my code:
N=10000; %number of data bits
Digital communication :: 02.05.2012 20:10 :: yamid :: Replies: 0 :: Views: 320
Hello everyone,
I have written a matlab code for BPSK modulation. Here in the program, I have first generated random binary bits. Modulated the bits with BPSK modulation. Added noise to the bpsk modulated signal. My matlab code is as follows:
clc;
close all;
clear all; (...)
Digital communication :: 23.08.2012 07:03 :: Shruti01 :: Replies: 1 :: Views: 199
hello,
I'm working in my Graduation Project on MIMO-OFDM Implementation using matlab
i made the following code but i m a little lost , can't figure out what to do next ,
i generated the data , modulated them , then branched the data into 2 branches to be sent , but i cant figure out how to multiply the channel matrix by the modulated data matrix
Digital communication :: 13.03.2013 19:47 :: ruwad :: Replies: 3 :: Views: 513
Advanced transient waveform digitizers.
A series of multi-channel transient waveform digitization integrated circuits with up to 5 GHz sample rates and parallel
10-bit digitization has been designed, tested, and fabricated in large quantities. The current CMOS circuit uses four
arrays of
Hobby Circuits and Small Projects Problems :: 19.07.2004 23:24 :: dainis :: Replies: 490 :: Views: 370487
use verilog to generate the test pakage
and simulate use hspice
Analog Circuit Design :: 14.01.2005 11:08 :: layes2 :: Replies: 4 :: Views: 1872
I don't think we should deal with anything regarding the circuit or protocol or connection between 877 and 4550 yet. I think ALL we need is written in the 4550 bins supplied with MPLAB.
We should write a bootloader compatible with the icd2w2k.sys to get the OS.bin downloaded, and after that we can scracth our heads how the 877 is connected.
[siz
Microcontrollers :: 05.04.2006 22:32 :: Zedman :: Replies: 1853 :: Views: 469122
This program is for Space-Time Turbo Coder and all the required modulation methods are included.
%Space-Time Turbo Coder
echo off
clear all
clear
clc
dec_alg = input(' Please enter the decoding algorithm. (0:Log-MAP, 1:SOVA) default 0 ');
if isempty(dec_alg)
dec_alg = 0;
end
awgn = input(' Please choose AWGN/Rayleigh (+1/-1): d
Digital communication :: 17.08.2006 21:31 :: ahmedseu :: Replies: 3 :: Views: 1726
hi can u help me i m having the same problem of getting a ber of 0.5 when passing the signal through rayleigh i have to perform any equalization if then how?
shuld i use interlaving ?
m not working on simulink i have to generate matlab code
i m working on Mimo-ofdm as my MSc Project.
i will be very thankful if u can help m
Digital communication :: 29.07.2009 01:18 :: Asifmarri :: Replies: 14 :: Views: 10361
Hi everyone, currently i am doing a system level design for a direct-convertion receiver by using simulink, including create the AGC block diagram,etc. it is my first time to do the system level design, i have spent more than a month on reading papers and searching online for the detail of the block design using simulink, but all of them just tell
Analog Circuit Design :: 01.11.2006 03:07 :: kobesitu :: Replies: 7 :: Views: 648
how one can generate two path fading and transmiits ddata on it in matlab ?
Digital communication :: 31.01.2007 08:17 :: israilsaifi :: Replies: 11 :: Views: 12045
dear friends..
did anybody used the function by name : rayleighchan in matlab..
actually when i use this function for simulating my ofdm system by making dopler frequency = 0 working well..but when i make dopler frequncy Fd is varying the code is not giving any performance variations..
could u pls suggest me whether i have
Digital communication :: 05.09.2007 21:13 :: mar_deepmode :: Replies: 4 :: Views: 2290
some PICs need more
Interesting, can you post some instance?
From "PICkit 2 Readme.txt":
-----------------------------------------------------------------
1. Device Support List
-----------------------------------------------------------------
(...)
+ Indicates parts that require 4.75V minimu
Microcontrollers :: 04.10.2007 01:57 :: psmll :: Replies: 154 :: Views: 116447
Ideally, random sequences should have a infinite length. But Pseudo-random (PN) sequences are finite length sequences with semi-randomness in the elements in sequences. Some examples are M (or maximal length)-sequence, Gold sequence. They show good but not ideal correlation properties, i.e., auto-correlation for non-zero shifts and (...)
Digital communication :: 19.05.2008 15:10 :: nalino :: Replies: 6 :: Views: 3072