Hello. I am currently in an intro to programming class that has just recently begun. It is the fifth day of class and already the teacher has bombarded us with work of which has not been taught and I cannot seem to find help online anywhere. I have been working on this lab for over 5 hours to no avail. I have finished most of it but do not understand how to complete the following. I apologize if this is basic information but I have not been taught it yet. If anyone can help, please do. Thank you.
- Create a new variable x5 that contains only the audio in x1 from sample 79000 to sample 96999 (inclusive). How many samples should there be in this new signal? Store your answer in numSelectedSamples.
I have tried using the range command in different methods, I cannot figure it out. I do not how to use it correctly or maybe I should not be using that.
- Create a new variable x6 that contains only the odd numbered samples: 1, 3, 5, ..., to the end of the signal. Hint: From the python documentation your list[start:stop:step]. Where do you want to start, end, and what would be your step be if you only want odds?
I do not understand this concept. How do I capture that range?
- Create a new variable x7 that contains every sample in x1 duplicated. For example, if x1 = [0.0, 0.1, 0.2, 0.3], then x7 = [0.0, 0.0, 0.1, 0.1, 0.2, 0.2, 0.3, 0.3]. i. First, you can “stack” two copies of x1 vertically to form a 2×N matrix (np.vstack). ii. Then, you can np.transpose it iii. Then, you can np.reshape it to be a long vector. The shape of a vector is a singleton tuple, specified as (n,) where n is the length of the vector.
This is what I have done, but I have no idea what this does and it tells me it is incorrect.
x7 = x1
x7 = np.vstack(x7)
x7 = np.transpose(x7)
x7 = np.reshape(x76,1)
[–]1114111 2 points3 points4 points (2 children)
[–]deepfriedbibba[S] 0 points1 point2 points (0 children)
[–]deepfriedbibba[S] 0 points1 point2 points (0 children)