clc; clearvars; % Read the file [y, Fs]=audioread('106miles.wav'); N=length(y); Nfft 2^nextpow2 (N); dt=1/Fs; t=0: dt:dt* (N-1); y=transpose(y); % Pad zeros y_nfft=zeros(Nfft,1); y_nfft (1:length(y)) =y; % Calculate Power (time domain) power_TDomainSignal=sum(y_nfft. ^2)/length (y_nfft); disp(['Power (time domain): num2str(power_TDomainSignal)]); % FFT Y=fft (y,Nfft)/Nfft; % Calculate power (frequency domain) power_FDomainSignal=sum(abs (Y).^2); disp(['Power (frequency domain): num2str(power_FDomainSignal)]); % Delete DC Y_NODC=Y; Y_NODC (1)=0; % IFFT y2=ifft (Y*Nfft, Nfft, 'symmetric'); y2_NoDC=ifft (Y_NoDC*Nfft, Nfft, 'symmetric'); % Calculate RMS RMSE_y2=rms(y_nfft'-y2); RMSE_Y2_NODC=rms (y_nfft'-y2_NODC); disp( ( 'RMS Error of Case 1: disp( ( 'RMS Error of Case 2: num2str(RMSE_y2_NODC)]); ' num2str(RMSE_y2)]); disp([ 'Mean of Original Siganl: num2str(mean (y_nfft))]); ' Matlab problems: Use the .wav (modified so the DC component is zero) file to generate a DSB-SC modulated waveform. Use a carrier frequency of 25KHz. Along with your code, turn in plots of the time domain signal and the frequency domain signal of the modulated carrier. Scale the axis appropriately. State your observations about the results. Suggestions: The .wav and the carrier wave vectors need to be the same length and must keep a relative time alignment; that is, have the sample interval. The matlab command 'resample' can be used to add points (up sample) the .wav file. That is, resample can be used to change the effective sample interval of the original file.

Introductory Circuit Analysis (13th Edition)
13th Edition
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:Robert L. Boylestad
Chapter1: Introduction
Section: Chapter Questions
Problem 1P: Visit your local library (at school or home) and describe the extent to which it provides literature...
icon
Related questions
Question

Use the code to answer the matlab question 

clc;
clearvars;
% Read the file
[y, Fs]=audioread('106miles.wav');
N=length(y);
Nfft 2^nextpow2 (N);
dt=1/Fs;
t=0: dt:dt* (N-1);
y=transpose(y);
% Pad zeros
y_nfft=zeros(Nfft,1);
y_nfft (1:length(y)) =y;
% Calculate Power (time domain)
power_TDomainSignal=sum(y_nfft. ^2)/length (y_nfft);
disp(['Power (time domain):
num2str(power_TDomainSignal)]);
% FFT
Y=fft (y,Nfft)/Nfft;
% Calculate power (frequency domain)
power_FDomainSignal=sum(abs (Y).^2);
disp(['Power (frequency domain):
num2str(power_FDomainSignal)]);
% Delete DC
Y_NODC=Y;
Y_NODC (1)=0;
% IFFT
y2=ifft (Y*Nfft, Nfft, 'symmetric');
y2_NoDC=ifft (Y_NoDC*Nfft, Nfft, 'symmetric');
% Calculate RMS
RMSE_y2=rms(y_nfft'-y2);
RMSE_Y2_NODC=rms (y_nfft'-y2_NODC);
disp( ( 'RMS Error of Case 1:
disp( ( 'RMS Error of Case 2:
num2str(RMSE_y2_NODC)]);
'
num2str(RMSE_y2)]);
disp([ 'Mean of Original Siganl:
num2str(mean (y_nfft))]);
'
Transcribed Image Text:clc; clearvars; % Read the file [y, Fs]=audioread('106miles.wav'); N=length(y); Nfft 2^nextpow2 (N); dt=1/Fs; t=0: dt:dt* (N-1); y=transpose(y); % Pad zeros y_nfft=zeros(Nfft,1); y_nfft (1:length(y)) =y; % Calculate Power (time domain) power_TDomainSignal=sum(y_nfft. ^2)/length (y_nfft); disp(['Power (time domain): num2str(power_TDomainSignal)]); % FFT Y=fft (y,Nfft)/Nfft; % Calculate power (frequency domain) power_FDomainSignal=sum(abs (Y).^2); disp(['Power (frequency domain): num2str(power_FDomainSignal)]); % Delete DC Y_NODC=Y; Y_NODC (1)=0; % IFFT y2=ifft (Y*Nfft, Nfft, 'symmetric'); y2_NoDC=ifft (Y_NoDC*Nfft, Nfft, 'symmetric'); % Calculate RMS RMSE_y2=rms(y_nfft'-y2); RMSE_Y2_NODC=rms (y_nfft'-y2_NODC); disp( ( 'RMS Error of Case 1: disp( ( 'RMS Error of Case 2: num2str(RMSE_y2_NODC)]); ' num2str(RMSE_y2)]); disp([ 'Mean of Original Siganl: num2str(mean (y_nfft))]); '
Matlab problems:
Use the .wav (modified so the DC component is zero) file to generate a DSB-SC modulated waveform.
Use a carrier frequency of 25KHz.
Along with your code, turn in plots of the time domain signal and the frequency domain signal of the
modulated carrier. Scale the axis appropriately.
State your observations about the results.
Suggestions:
The .wav and the carrier wave vectors need to be the same length and must keep a relative time
alignment; that is, have the sample interval. The matlab command 'resample' can be used to add points
(up sample) the .wav file. That is, resample can be used to change the effective sample interval of the
original file.
Transcribed Image Text:Matlab problems: Use the .wav (modified so the DC component is zero) file to generate a DSB-SC modulated waveform. Use a carrier frequency of 25KHz. Along with your code, turn in plots of the time domain signal and the frequency domain signal of the modulated carrier. Scale the axis appropriately. State your observations about the results. Suggestions: The .wav and the carrier wave vectors need to be the same length and must keep a relative time alignment; that is, have the sample interval. The matlab command 'resample' can be used to add points (up sample) the .wav file. That is, resample can be used to change the effective sample interval of the original file.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
Recommended textbooks for you
Introductory Circuit Analysis (13th Edition)
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:
9780133923605
Author:
Robert L. Boylestad
Publisher:
PEARSON
Delmar's Standard Textbook Of Electricity
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:
9781337900348
Author:
Stephen L. Herman
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Electrical Engineering
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education
Fundamentals of Electric Circuits
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:
9780078028229
Author:
Charles K Alexander, Matthew Sadiku
Publisher:
McGraw-Hill Education
Electric Circuits. (11th Edition)
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:
9780134746968
Author:
James W. Nilsson, Susan Riedel
Publisher:
PEARSON
Engineering Electromagnetics
Engineering Electromagnetics
Electrical Engineering
ISBN:
9780078028151
Author:
Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:
Mcgraw-hill Education,