Question

In MATLAB create a sine wave with slow varying frequency. The average freqeuncy is 20hz. The...

In MATLAB create a sine wave with slow varying frequency. The average freqeuncy is 20hz. The slow frequency is 1Hz. The [f min, fmax] = [15, 25]Hz. Plot the waveform, power spectrum, and spectrogram.

Homework Answers

Answer #1

MATLAB code is given below followed by the plots.

The code is in bold letters.

clc;
close all;
clear all;

% Sqweep from 15 Hz to 25 Hz
Fs = 1000;
Ts = 1/Fs;
t = 0:Ts:2;
x = chirp(t,15,2,25);
figure;plot(t,x);xlabel('Time(s)');ylabel('Amplitude');
xlim([-0.1 2.1]);ylim([-1.1 1.1]);grid;
title('sweep of frequencies 15 Hz to 25 Hz');

% Spectrum
X = fft(x);
L = length(X);
P2 = abs(X/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
f = Fs*(0:(L/2))/L;
figure;
plot(f,P1);grid;
title('Single-Sided Amplitude Spectrum Chirp')
xlabel('f (Hz)');xlim([0 50]);
ylabel('Magnitude')


% Spectrogram
F = 0:.1:100;
[y,f,t,p] = spectrogram(x,256,250,F,1E3,'yaxis');
figure;surf(t,f,10*log10(abs(p)),'EdgeColor','none');
axis xy; axis tight; colormap(jet); view(0,90);
xlabel('Time');title('Spectrogram');
ylabel('Frequency (Hz)');

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
A single phase AC induction motor need to be controlled by varying its input frequency. The...
A single phase AC induction motor need to be controlled by varying its input frequency. The supply frequency is a single phase with 50 Hz and the input frequency to the motor is controlled to be 12.5 Hz. Design a Full-wave rectifier (Cycloconverter), show the conversion of 5 cycles, and explain its operation. And show how the output voltage of Cycloconverters can be controlled to get a waveform shape near sine wave.
Consider a 10 Hz sine wave sampled at 35 Hz. If the samples are plotted and...
Consider a 10 Hz sine wave sampled at 35 Hz. If the samples are plotted and displayed using linear interpolation, you will see that the reconstructed waveform will not resemble the original continuous-time sine wave. Show how sinc interpolation can be used to reconstruct the original continuous-time signal. (Hint: In this question you are being asked to resample the sine wave to a higher sampling rate of, say, 105Hz, by sinc interpolation – i.e., convolution with a sinc function) Please...
Write a Matlab program to plot the cosine wave. That is plot y=cos(k1x) vs. x for...
Write a Matlab program to plot the cosine wave. That is plot y=cos(k1x) vs. x for x varying from 0 to 2pi radians. The value of k1 is given at the end of this document. You can choose the increment for x. Note that large values of the increment will give you a coarse graph. Note: Matlab has two functions to calculate the sine of an angle: sin(x) and sind(x). What is the difference between these two functions? Use help...
I am using matlab and getting a "matrix dimensions error below" for line 22. Can someone...
I am using matlab and getting a "matrix dimensions error below" for line 22. Can someone spot the error and try the code to fix the error. %The beginning step is to generate a functionf(t) that consists of the sum %of the following components % 25 Hz cosine function of magnitude 1 % 50 Hz sine function of magnitude 1 % 40 Hz square wave function of magnitude 1 clear; clc; close all; %sample rate is given at 2500 Hz...
100 Hz wave with an average power 40W and amplitude 1.5cm travels on a 4m long...
100 Hz wave with an average power 40W and amplitude 1.5cm travels on a 4m long string. The tension in the string is 60N. Determine the frequency when tension in string is 50N and amplitude and power remain constant. A. 105 Hz B. 105.70 Hz C. 104.66 Hz D. 118.3 Hz E. 97.70 Hz
A traveling wave on a string oscillates with an amplitude of 0.080m and a frequency of...
A traveling wave on a string oscillates with an amplitude of 0.080m and a frequency of 2.5Hz. The speed of the waves on the string is 10 m/s. At t=0, the end from which the oscillations originate has a vertical displacement of 0m. a) Find the angular frequency, period, wavelength, and wave number. b) Write a wave function describing the wave. c) The linear mass density μ of the string is 0.300kg/m, and tension in the spring is maintained at...
chapter 24 part 2 1. What is the frequency of a 17.7 m wavelength radio wave? ...
chapter 24 part 2 1. What is the frequency of a 17.7 m wavelength radio wave?  Give your answe in MHz. 2. A 2.34 m diameter university communications satellite dish receives TV signals that have a maximum electric field strength (for one channel) of 7.51 μV/m. What is the power received by the dish in 10-13 W? 3. A radio antenna can pick up wavelengths between 2.6 μm and 57.2 μm.  How much of the frequency spectrum in (in 1013 Hz) does...
PLEASE USE MAT LAB ONLY. THANK YOU (a) Create and plot the signals listed below and...
PLEASE USE MAT LAB ONLY. THANK YOU (a) Create and plot the signals listed below and save your Matlab code in a script file. i) Cosine signal of frequency 100 Hz over the range [0,0.1] seconds and samples spaced 10^- 4 seconds apart with a phase of pi/2 and an amplitude of 1.   PLEASE USE MAT LAB ONLY. THANK YOU ii) A square wave that oscillates between 0 and 1 every five samples, plot 3 periods of the waveform. iii)...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...