1
0
This repository has been archived on 2024-09-17. You can view files and clone it, but cannot push or open issues or pull requests.
SDI-TransmissionProcesses/F_Bluetooth/commbluetoothvoice_init.m

44 lines
963 B
Mathematica
Raw Permalink Normal View History

2023-09-27 06:23:10 +00:00
%COMMBLUETOOTHVOICE_INIT Initializes variables for Bluetooth Voice Transmission
% example (commbluetoothvoice.slx)
% Copyright 1996-2012 The MathWorks, Inc.
% modified for Matlab 2022a by mag, HES-SO Valais, course SDi
% Set input wave sample rate to be 8kHz
Input_Fs=8000;
sigin = audioread('commbluetoothvoice_input.wav');
% Coefficients for speech interpolation
[y,interp_coeffs]=interp(ones(1,10),8);
% Header Information
% Header_Info=[Slave_Address;Packet_Type;Flow_Control;ARQ;Sequence];
Slave_Address= [1 0 1]';
Packet_Type= [1 0 1 0]';
Flow_Control= [1];
ARQ=[1];
Sequence=[1];
Access_Code=zeros(72,1); Access_Code(1:2:72)=1;
% Initialize 1,0,1,0, sequence
One_Zero_Payload=zeros(240,1);
One_Zero_Payload(1:2:240)=1;
% Set Seeds
% modified by mag: replaced randseed() by ''
hop_seed=1;
awgn_channel_seed=2;
awgn_802_seed=3;
rate_802_seed=4;
data_seed=5;
% Hop frequency if fixed
fixed_hop_freq=20;
% Assign payload bits
Num_Payload_Bits=80;